Skip to content

Commit

Permalink
Adds influxdb user to alpine Dockerfiles
Browse files Browse the repository at this point in the history
Allow containers to be run as non root by adding an influxdb user and 
group. Home directory of the user is set to the data dir of influx
  • Loading branch information
anguswilliams committed Apr 9, 2020
1 parent 29ba808 commit 0c101ba
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion influxdb/1.5/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ RUN set -ex && \
chmod +x /usr/src/influxdb-*/* && \
cp -a /usr/src/influxdb-*/* /usr/bin/ && \
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
apk del .build-deps
apk del .build-deps && \
addgroup -g 1000 influxdb && \
adduser -G influxdb -u 1000 -S -h /var/lib/influxdb influxdb
COPY influxdb.conf /etc/influxdb/influxdb.conf

EXPOSE 8086
Expand Down
4 changes: 3 additions & 1 deletion influxdb/1.6/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ RUN set -ex && \
chmod +x /usr/src/influxdb-*/* && \
cp -a /usr/src/influxdb-*/* /usr/bin/ && \
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
apk del .build-deps
apk del .build-deps && \
addgroup -g 1000 influxdb && \
adduser -G influxdb -u 1000 -S -h /var/lib/influxdb influxdb
COPY influxdb.conf /etc/influxdb/influxdb.conf

EXPOSE 8086
Expand Down
4 changes: 3 additions & 1 deletion influxdb/1.7/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ RUN set -ex && \
chmod +x /usr/src/influxdb-*/* && \
cp -a /usr/src/influxdb-*/* /usr/bin/ && \
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
apk del .build-deps
apk del .build-deps && \
addgroup -g 1000 influxdb && \
adduser -G influxdb -u 1000 -S -h /var/lib/influxdb influxdb
COPY influxdb.conf /etc/influxdb/influxdb.conf

EXPOSE 8086
Expand Down
4 changes: 3 additions & 1 deletion influxdb/nightly/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ RUN set -ex && \
chmod +x /usr/src/influxdb-*/* && \
cp -a /usr/src/influxdb-*/* /usr/bin/ && \
rm -rf *.tar.gz* /usr/src /root/.gnupg && \
apk del .build-deps
apk del .build-deps && \
addgroup -g 1000 influxdb && \
adduser -G influxdb -u 1000 -S -h /var/lib/influxdb influxdb
COPY influxdb.conf /etc/influxdb/influxdb.conf

EXPOSE 8083 8086
Expand Down

0 comments on commit 0c101ba

Please sign in to comment.