From a9184368c12f7f5be975bc83b091316b2ce2c86f Mon Sep 17 00:00:00 2001 From: Arne Riemann Date: Sat, 15 Jul 2017 06:38:36 +0200 Subject: [PATCH 1/2] Set UID for ES_DEFAULT_USER to 1100, avoid conflicts with debian host systems --- elasticsearch/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile index c986571a..c987e8fe 100755 --- a/elasticsearch/Dockerfile +++ b/elasticsearch/Dockerfile @@ -5,6 +5,8 @@ LABEL maintainer "itzg" RUN apk -U add bash ARG ES_VERSION=5.5.0 +# avoid conflicts with debian host systems when mounting to host volume +ARG DEFAULT_ES_USER_UID=1100 ADD https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-$ES_VERSION.tar.gz /tmp # need to adapt to both Docker's new remote-unpack-ADD behavior and the old behavior @@ -21,6 +23,7 @@ HEALTHCHECK --timeout=5s CMD wget -q -O - http://$HOSTNAME:9200/_cat/health ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \ DEFAULT_ES_USER=elasticsearch \ + DEFAULT_ES_USER_UID=$DEFAULT_ES_USER_UID \ ES_JAVA_OPTS="-Xms1g -Xmx1g" RUN adduser -S -s /bin/sh $DEFAULT_ES_USER From 2cab10e906a5a3f12021161486ecbab0a04d63ed Mon Sep 17 00:00:00 2001 From: Arne Riemann Date: Sun, 16 Jul 2017 16:09:28 +0200 Subject: [PATCH 2/2] Forgot -u for UID --- elasticsearch/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile index c987e8fe..0141f1cd 100755 --- a/elasticsearch/Dockerfile +++ b/elasticsearch/Dockerfile @@ -26,7 +26,7 @@ ENV ES_HOME=/usr/share/elasticsearch-$ES_VERSION \ DEFAULT_ES_USER_UID=$DEFAULT_ES_USER_UID \ ES_JAVA_OPTS="-Xms1g -Xmx1g" -RUN adduser -S -s /bin/sh $DEFAULT_ES_USER +RUN adduser -S -s /bin/sh -u $DEFAULT_ES_USER_UID $DEFAULT_ES_USER VOLUME ["/data","/conf"]