Skip to content

Commit 50dbe8e

Browse files
fgimenezfjl
authored andcommitted
Dockerfile: use non-privileged user account (#16052)
1 parent ec8ee61 commit 50dbe8e

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,11 @@ FROM alpine:latest
1212
RUN apk add --no-cache ca-certificates
1313
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
1414

15+
RUN addgroup -g 1000 geth && \
16+
adduser -h /root -D -u 1000 -G geth geth && \
17+
chown geth:geth /root
18+
19+
USER geth
20+
1521
EXPOSE 8545 8546 30303 30303/udp 30304/udp
1622
ENTRYPOINT ["geth"]

Dockerfile.alltools

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,10 @@ FROM alpine:latest
1212
RUN apk add --no-cache ca-certificates
1313
COPY --from=builder /go-ethereum/build/bin/* /usr/local/bin/
1414

15+
RUN addgroup -g 1000 geth && \
16+
adduser -h /root -D -u 1000 -G geth geth \
17+
chown geth:geth /root
18+
19+
USER geth
20+
1521
EXPOSE 8545 8546 30303 30303/udp 30304/udp

0 commit comments

Comments
 (0)