parent
ec99d397ea
commit
1fb49b8df2
1 changed files with 22 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||||||
|
# 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"] |
||||||
Loading…
Reference in new issue