Skip to content

Commit

Permalink
Merge pull request #137 from kubescape/distroless
Browse files Browse the repository at this point in the history
use distroless base image
  • Loading branch information
matthyx authored Aug 10, 2023
2 parents b1a0f69 + ecc609d commit e7b8d3d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=$BUILDPLATFORM golang:1.20-alpine as builder
FROM --platform=$BUILDPLATFORM golang:1.20-bullseye as builder

ENV GO111MODULE=on CGO_ENABLED=0
WORKDIR /work
Expand All @@ -9,11 +9,10 @@ RUN --mount=target=. \
--mount=type=cache,target=/go/pkg \
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /out/kubevuln cmd/http/main.go

FROM alpine
FROM gcr.io/distroless/static-debian11:nonroot

RUN addgroup -S ks && adduser -S ks -G ks
USER ks
WORKDIR /home/ks/
USER nonroot
WORKDIR /home/nonroot/

COPY --from=builder /out/kubevuln /usr/bin/kubevuln

Expand Down

0 comments on commit e7b8d3d

Please sign in to comment.