@@ -21,16 +21,15 @@ FROM ${SPLUNK_BASE_IMAGE}:latest as package
2121ARG SPLUNK_BUILD_URL
2222COPY splunk/common-files/make-minimal-exclude.py /tmp
2323RUN python /tmp/make-minimal-exclude.py ${SPLUNK_BUILD_URL} > /tmp/splunk-minimal-exclude.list
24- RUN echo "Downloading Splunk and validating the checksum at: ${SPLUNK_BUILD_URL}"
2524RUN wget -qO /tmp/splunk.tgz ${SPLUNK_BUILD_URL}
2625RUN wget -qO /tmp/splunk.tgz.md5 ${SPLUNK_BUILD_URL}.md5
2726RUN test $(md5sum /tmp/splunk.tgz | sed 's,\( [a-z0-9]*\) .*,\1 ,' ) = $(cat /tmp/splunk.tgz.md5 | sed 's,MD5.*=.\( [a-z0-9]*\) .*,\1 ,' )
28- RUN mkdir -p /opt/splunk/var / minimal/splunk/var /extras/splunk/var
27+ RUN mkdir -p /minimal/splunk/var /extras/splunk/var
2928RUN tar -C /minimal/splunk --strip 1 --exclude-from=/tmp/splunk-minimal-exclude.list -zxf /tmp/splunk.tgz
3029RUN tar -C /extras/splunk --strip 1 --wildcards --files-from=/tmp/splunk-minimal-exclude.list -zxf /tmp/splunk.tgz
3130RUN mv /minimal/splunk/etc /minimal/splunk-etc
3231RUN mv /extras/splunk/etc /extras/splunk-etc
33- RUN mkdir -p /minimal/splunk/share/splunk/search_mrsparkle/modules.new
32+ RUN mkdir -p /minimal/splunk/etc /minimal/splunk/ share/splunk/search_mrsparkle/modules.new
3433COPY splunk/common-files/apps /extras/splunk-etc/apps/
3534
3635
@@ -56,7 +55,8 @@ COPY [ "splunk/common-files/updateetc.sh", "/sbin/" ]
5655
5756# Setup users and groups
5857RUN groupadd -r -g ${GID} ${SPLUNK_GROUP} \
59- && useradd -r -m -u ${UID} -g ${GID} ${SPLUNK_USER} \
58+ && useradd -r -m -u ${UID} -g ${GID} -s /sbin/nologin -d ${SPLUNK_HOME} ${SPLUNK_USER} \
59+ && chown -R splunk.splunk ${SPLUNK_HOME} \
6060 && chmod 755 /sbin/updateetc.sh
6161
6262COPY --from=package --chown=splunk:splunk /minimal /opt
0 commit comments