Skip to content

Commit

Permalink
enhance: change to distroless base image
Browse files Browse the repository at this point in the history
Signed-off-by: JenTing Hsiao <[email protected]>
  • Loading branch information
jenting committed Nov 18, 2024
1 parent 1372016 commit bc24665
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
FROM golang:1.23.2 as builder
FROM golang:1.23.2 AS builder
WORKDIR /workspace
COPY go.mod go.sum /workspace/
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -a -o manager main.go

FROM alpine:3.20.3
RUN apk update && apk add --no-cache ca-certificates
FROM gcr.io/distroless/static:nonroot
WORKDIR /
COPY --from=builder /workspace/manager .
USER nobody
Expand Down

0 comments on commit bc24665

Please sign in to comment.