Dockerfile (439B)
1 # A distroless image in a multi-stage build ready for multi-arch builds 2 3 FROM golang:1.23 AS build 4 5 WORKDIR /usr/src/app 6 7 # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change 8 COPY go.mod go.sum ./ 9 RUN go mod download && go mod verify 10 11 COPY . . 12 RUN CGO_ENABLED=0 go build -o /go/bin/app 13 14 FROM gcr.io/distroless/static-debian12 15 16 COPY --from=build /go/bin/app / 17 CMD ["/app"]