zotregistry.dev/zot@v1.4.4-0.20240314164342-eec277e14d20/build/Dockerfile-zb (about) 1 # --- 2 # Stage 1: Install certs, build binary, create default config file 3 # --- 4 FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.21 AS builder 5 6 ARG TARGETOS 7 ARG TARGETARCH 8 ARG COMMIT 9 10 RUN mkdir -p /go/src/github.com/project-zot/zot 11 WORKDIR /go/src/github.com/project-zot/zot 12 COPY . . 13 RUN make COMMIT=$COMMIT OS=$TARGETOS ARCH=$TARGETARCH clean bench 14 15 # --- 16 # Stage 2: Final image with nothing but certs, binary, and default config file 17 # --- 18 FROM gcr.io/distroless/base-debian12 AS final 19 ARG TARGETOS 20 ARG TARGETARCH 21 COPY --from=builder /go/src/github.com/project-zot/zot/bin/zb-$TARGETOS-$TARGETARCH /usr/bin/zb 22 ENTRYPOINT ["/usr/bin/zb"]