File tree Expand file tree Collapse file tree 2 files changed +2
-23
lines changed Expand file tree Collapse file tree 2 files changed +2
-23
lines changed Original file line number Diff line number Diff line change 1
1
FROM alpine:3.14
2
2
3
3
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
4
- RUN apk add --no-cache tzdata bash ca-certificates gnupg run-parts && \
4
+ RUN apk add --no-cache tzdata bash ca-certificates gnupg run-parts su-exec && \
5
5
update-ca-certificates
6
6
7
7
RUN addgroup -S -g 1000 influxdb && \
8
8
adduser -S -G influxdb -u 1000 -h /home/influxdb -s /bin/sh influxdb && \
9
9
mkdir -p /home/influxdb && \
10
10
chown -R influxdb:influxdb /home/influxdb
11
11
12
- # Install gosu for easy step-down from root.
13
- # https://github.com/tianon/gosu/releases
14
- ENV GOSU_VER 1.12
15
- RUN set -eux; \
16
- ARCH="$(apk --print-arch)" && \
17
- case "${ARCH}" in \
18
- x86_64) ARCH=amd64;; \
19
- aarch64) ARCH=arm64;; \
20
- *) echo "Unsupported architecture: ${ARCH}" ; exit 1;; \
21
- esac && \
22
- wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-$ARCH" ; \
23
- wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VER/gosu-$ARCH.asc" ; \
24
- export GNUPGHOME="$(mktemp -d)" ; \
25
- gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
26
- gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
27
- gpgconf --kill all; \
28
- rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
29
- chmod +x /usr/local/bin/gosu; \
30
- gosu --version; \
31
- gosu nobody true
32
-
33
12
# Install the infuxd server
34
13
ENV INFLUXDB_VERSION 2.1.1
35
14
RUN set -eux && \
Original file line number Diff line number Diff line change @@ -386,7 +386,7 @@ function main () {
386
386
fi
387
387
388
388
if [ " $( id -u) " = 0 ]; then
389
- exec gosu influxdb " $BASH_SOURCE " " ${@ } "
389
+ exec su-exec influxdb " $BASH_SOURCE " " ${@ } "
390
390
return
391
391
fi
392
392
You can’t perform that action at this time.
0 commit comments