Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…search container can now be run as non-root. This commit uses Malcolm's normal "drop privileges" pattern so that by the time the docker entrypoint for the ODFE container is called we are already a non-root user.
  • Loading branch information
mmguero committed Apr 8, 2021
1 parent e2ca5e4 commit f0a4aa8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Dockerfiles/elasticsearch.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,18 @@ RUN yum install -y openssl && \
/usr/share/elasticsearch/bin/elasticsearch-plugin remove opendistro_security && \
echo -e 'cluster.name: "docker-cluster"\nnetwork.host: 0.0.0.0' > /usr/share/elasticsearch/config/elasticsearch.yml && \
chown -R $PUSER:$PGROUP /usr/share/elasticsearch/config/elasticsearch.yml && \
sed -i "s/\b1000\b/\${PUID:-${DEFAULT_UID}}/g" /usr/local/bin/docker-entrypoint.sh && \
sed -i '/[^#].*\/usr\/share\/elasticsearch\/bin\/elasticsearch.*/i /usr/local/bin/jdk-cacerts-auto-import.sh || true' /usr/local/bin/docker-entrypoint.sh

# just used for initial keystore creation
ADD shared/bin/docker-uid-gid-setup.sh /usr/local/bin/
ADD shared/bin/jdk-cacerts-auto-import.sh /usr/local/bin/

USER root

ENTRYPOINT ["/usr/local/bin/docker-uid-gid-setup.sh"]

CMD ["/usr/local/bin/docker-entrypoint.sh"]

# to be populated at build-time:
ARG BUILD_DATE
ARG MALCOLM_VERSION
Expand Down

0 comments on commit f0a4aa8

Please sign in to comment.