Docker file dependency + non-root checking
This commit is contained in:
@@ -27,11 +27,14 @@ WORKDIR /app/identity-manager
|
|||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server
|
||||||
|
|
||||||
# ---- Runtime Stage ----
|
# ---- Runtime Stage ----
|
||||||
FROM gcr.io/distroless/base-debian12
|
FROM debian:bookworm-slim
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=builder /app/identity-manager/server .
|
COPY --from=builder /app/identity-manager/server .
|
||||||
|
|
||||||
|
RUN groupadd -r nonroot && useradd -r -g nonroot nonroot && chown -R nonroot:nonroot /app
|
||||||
|
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
USER nonroot:nonroot
|
USER nonroot:nonroot
|
||||||
ENTRYPOINT ["/app/server"]
|
ENTRYPOINT ["/app/server"]
|
||||||
Reference in New Issue
Block a user