Skip to content

Commit 92dd109

Browse files
committed
Switch runtime base image to Alpine for improved simplicity and maintainability
1 parent 137a0f6 commit 92dd109

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,16 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -ldflags="-w -s" -o manage
2424

2525
# Runtime Stage
2626
# Use a distroless image for a minimal attack surface
27-
FROM gcr.io/distroless/static-debian11:nonroot AS runtime
28-
# For debugging, you might temporarily use a different base like alpine:
29-
# FROM alpine:latest
30-
# RUN apk add --no-cache ca-certificates
27+
FROM alpine:latest AS runtime
28+
29+
RUN apk add --no-cache ca-certificates
3130

3231
WORKDIR /
3332
# Copy the compiled binary from the builder stage
3433
COPY --from=builder /workspace/manager .
35-
# Copy CA certificates if needed (distroless/static usually includes them)
36-
# COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
3734

38-
USER nonroot:nonroot
35+
# Use a non-root user (nobody:65534 is available in Alpine)
36+
USER nobody
3937

4038
# The binary is the entrypoint
4139
ENTRYPOINT ["/manager"]

0 commit comments

Comments
 (0)