Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
feat: use nonroot distroless as base image of ingress-pipy
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh committed Jan 1, 2023
1 parent 98aa3bd commit eaee0fa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dockerfiles/ingress-pipy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# syntax = docker/dockerfile:1.4
ARG TARGETOS
ARG TARGETARCH
ARG DISTROLESS_TAG

# Build the ingress-pipy binary
FROM --platform=$BUILDPLATFORM golang:1.19-alpine3.15 as builder
Expand All @@ -21,8 +22,15 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH make build/ingress-pipy

FROM flomesh/pipy:0.70.0-46
# Builder image, pipy
FROM flomesh/pipy:0.70.0-46-nonroot as pipy

# Build the final image
FROM gcr.io/distroless/base-debian11:$DISTROLESS_TAG
WORKDIR /
COPY --from=builder /workspace/bin/ingress-pipy .
COPY --from=pipy /usr/local/bin/pipy /usr/local/bin/pipy

USER 65532:65532

ENTRYPOINT ["/ingress-pipy"]

0 comments on commit eaee0fa

Please sign in to comment.