Skip to content

Commit

Permalink
Move to distroless
Browse files Browse the repository at this point in the history
Fixes: #58

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
  • Loading branch information
alexellis committed Oct 20, 2023
1 parent 5946558 commit e4a1e0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,11 @@ RUN go build -mod=vendor -ldflags "-s -w \
# ca-certificates and tmp folder are also missing in scratch
# so we add all of it here and copy files in next stage

FROM scratch

FROM --platform=${BUILDPLATFORM:-linux/amd64} gcr.io/distroless/static:nonroot as ship
LABEL org.opencontainers.image.source=https://github.com/openfaas/ingress-operator

COPY --from=builder /etc/passwd /etc/group /etc/
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder --chown=app:app /scratch-tmp /tmp/
WORKDIR /
COPY --from=builder /go/src/github.com/openfaas/ingress-operator/ingress-operator .
USER nonroot:nonroot

USER app

CMD ["./ingress-operator"]
CMD ["/ingress-operator"]
2 changes: 1 addition & 1 deletion artifacts/operator-amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ spec:
serviceAccountName: ingress-operator
containers:
- name: operator
image: docker.io/alexellis2/ingress-operator:1
image: docker.io/alexellis2/ingress-operator:2
imagePullPolicy: Always
command:
- ./ingress-operator
Expand Down

0 comments on commit e4a1e0f

Please sign in to comment.