Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions splunk/common-files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@ FROM ${SPLUNK_BASE_IMAGE}:latest as package
ARG SPLUNK_BUILD_URL
COPY splunk/common-files/make-minimal-exclude.py /tmp
RUN python /tmp/make-minimal-exclude.py ${SPLUNK_BUILD_URL} > /tmp/splunk-minimal-exclude.list
RUN echo "Downloading Splunk and validating the checksum at: ${SPLUNK_BUILD_URL}"
RUN wget -qO /tmp/splunk.tgz ${SPLUNK_BUILD_URL}
RUN wget -qO /tmp/splunk.tgz.md5 ${SPLUNK_BUILD_URL}.md5
RUN test $(md5sum /tmp/splunk.tgz | sed 's,\([a-z0-9]*\).*,\1,') = $(cat /tmp/splunk.tgz.md5 | sed 's,MD5.*=.\([a-z0-9]*\).*,\1,')
RUN mkdir -p /opt/splunk/var /minimal/splunk/var /extras/splunk/var
RUN mkdir -p /minimal/splunk/var /extras/splunk/var
RUN tar -C /minimal/splunk --strip 1 --exclude-from=/tmp/splunk-minimal-exclude.list -zxf /tmp/splunk.tgz
RUN tar -C /extras/splunk --strip 1 --wildcards --files-from=/tmp/splunk-minimal-exclude.list -zxf /tmp/splunk.tgz
RUN mv /minimal/splunk/etc /minimal/splunk-etc
RUN mv /extras/splunk/etc /extras/splunk-etc
RUN mkdir -p /minimal/splunk/share/splunk/search_mrsparkle/modules.new
RUN mkdir -p /minimal/splunk/etc /minimal/splunk/share/splunk/search_mrsparkle/modules.new
COPY splunk/common-files/apps /extras/splunk-etc/apps/


Expand All @@ -56,7 +55,8 @@ COPY [ "splunk/common-files/updateetc.sh", "/sbin/" ]

# Setup users and groups
RUN groupadd -r -g ${GID} ${SPLUNK_GROUP} \
&& useradd -r -m -u ${UID} -g ${GID} ${SPLUNK_USER} \
&& useradd -r -m -u ${UID} -g ${GID} -s /sbin/nologin -d ${SPLUNK_HOME} ${SPLUNK_USER} \
Copy link

@kyanite kyanite Jun 17, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change home of splunk user in here will broken internal splunk-orca image.
In my understanding, $SPLUNK_HOME is /opt/splunk, but the user splunk's home is better as /home/splunk

And also this PR broken the splunk-orca in https://git.splunk.com/projects/TOOLS/repos/infra-internal-base-images/browse/splunk-orca/x64_debian_9/Dockerfile

@mikedickey

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed confusing to me to have a "SPLUNK_HOME" which was not the same as the home directory for the user splunk. I assumed this was made different inadvertently by not explicitly specifying a home to useradd. I don't feel strongly about it one way or the other, and am curious to learn benefits of splitting it out.

&& chown -R splunk.splunk ${SPLUNK_HOME} \
&& chmod 755 /sbin/updateetc.sh

COPY --from=package --chown=splunk:splunk /minimal /opt
Expand Down