You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
389 B
22 lines
389 B
# Docker image definition
|
|
|
|
FROM golang:1.22-bookworm as go-build
|
|
|
|
WORKDIR /go/src/app
|
|
|
|
COPY ./*go .
|
|
|
|
RUN go mod init bbb && \
|
|
go mod tidy && \
|
|
CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -o /bbb .
|
|
|
|
# final image
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
|
|
USER nonroot:nonroot
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --chown=nonroot:nonroot --from=go-build /bbb /app/
|
|
|
|
ENTRYPOINT ["./bbb"]
|
|
|