Skip to content

Commit 907e097

Browse files
Update Dockerfile
1 parent 7dfb1d1 commit 907e097

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Variables
22
ARG ALPINE_VERSION=3.22
33
ARG GOLANG_VERSION=1.25.1
4+
ARG USERID=65532
45

56
FROM alpine:${ALPINE_VERSION} AS builder
67

@@ -20,12 +21,15 @@ RUN go build -o waitfor
2021
# Final-Stage ++++++++++++++++++++++++++++++++++++++++
2122
#
2223
FROM alpine:${ALPINE_VERSION}
24+
ARG USERID
2325

2426
# Create a non-root user "app" to run the application
25-
RUN addgroup -g 65532 app && adduser -u 65532 -G app -S app
27+
RUN addgroup -g ${USERID} app && adduser -u ${USERID} -G app -S app
2628

29+
# Copy compiled bin into final image
2730
COPY --from=builder /app/waitfor /usr/local/bin/waitfor
2831

29-
USER 65532:65532
32+
# Set to nonroot user
33+
USER ${USERID}:${USERID}
3034

3135
ENTRYPOINT ["waitfor"]

0 commit comments

Comments
 (0)