Skip to content

Commit

Permalink
Keep symlink, remove customizations for volumes/configsets
Browse files Browse the repository at this point in the history
  • Loading branch information
csandanov committed Feb 19, 2025
1 parent f2a3dce commit 8aea9bd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 40 deletions.
27 changes: 2 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,36 +90,13 @@ RUN set -ex; \
\
apk add --no-cache \
bash \
curl \
grep \
make \
procps-ng \
sudo; \
\
# 8.x version has a symlink and wrong permissions.
if [[ -d "/opt/solr-${SOLR_VER}" ]]; then \
rm -rf /opt/solr; \
mv "/opt/solr-${SOLR_VER}" /opt/solr; \
chown -R solr:solr /opt/solr /etc/default/; \
cd /opt/solr; \
fi; \
echo "chown solr:solr /opt/solr/server/solr" > /usr/local/bin/init_volumes; \
chmod +x /usr/local/bin/init_volumes; \
echo 'solr ALL=(root) NOPASSWD:SETENV: /usr/local/bin/init_volumes' > /etc/sudoers.d/solr; \
chown -R solr:solr /etc/default/; \
\
mkdir -p /opt/docker-solr/configsets; \
# Move out from volume to always keep them inside of the image.
mv /opt/solr/server/solr/configsets/* /opt/docker-solr/configsets/; \
mv /opt/solr/server/solr/solr.xml /opt/docker-solr/solr.xml; \
if [[ -d /tmp/configsets/"${SOLR_VER:0:1}"/ ]]; then \
cp -R /tmp/configsets/"${SOLR_VER:0:1}"/* /opt/docker-solr/configsets/; \
fi; \
chown -R solr:solr /opt/docker-solr/configsets; \
\
rm -rf \
/tmp/configsets \
/opt/solr/server/solr/mycores \
/var/cache/apk/*
rm -rf /var/cache/apk/*

COPY bin /usr/local/bin
COPY entrypoint.sh /
Expand Down
16 changes: 1 addition & 15 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,9 @@ if [[ -n "${DEBUG}" ]]; then
set -x
fi

sudo init_volumes

mkdir -p /opt/solr/server/solr/configsets

migrate

if [[ ! -f /opt/solr/server/solr/solr.xml ]]; then
ln -s /opt/docker-solr/solr.xml /opt/solr/server/solr/solr.xml
fi

if [[ -f /opt/solr/bin/solr.in.sh ]]; then
conf_file=/opt/solr/bin/solr.in.sh
else
conf_file=/etc/default/solr.in.sh
fi

sed -E -i 's@^#SOLR_HEAP=".*"@'"SOLR_HEAP=${SOLR_HEAP}"'@' "${conf_file}"
sed -E -i 's@^#SOLR_HEAP=".*"@'"SOLR_HEAP=${SOLR_HEAP}"'@' /etc/default/solr.in.sh

if [[ "${1}" == 'make' ]]; then
exec "$@" -f /usr/local/bin/actions.mk
Expand Down

0 comments on commit 8aea9bd

Please # to comment.