zotregistry.io/zot@v1.4.4-0.20231124084042-02a8ed785457/build/Dockerfile-conformance (about)

     1  # ---
     2  # Stage 1: Install certs, build binary, create default config file
     3  # ---
     4  FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.20 AS builder
     5  
     6  ARG TARGETOS
     7  ARG TARGETARCH
     8  ARG COMMIT
     9  
    10  RUN apt-get update && apt-get install -y git make ca-certificates
    11  RUN mkdir -p /go/src/github.com/project-zot/zot
    12  WORKDIR /go/src/github.com/project-zot/zot
    13  COPY . .
    14  RUN make COMMIT=$COMMIT OS=$TARGETOS ARCH=$TARGETARCH clean binary
    15  RUN echo '# Default config file for zot server\n\
    16  http:\n\
    17    address: 0.0.0.0\n\
    18    port: 5000\n\
    19  storage:\n\
    20    rootDirectory: /var/lib/registry\n\
    21    gc: false\n\
    22    dedupe: false' > config.yaml && cat config.yaml
    23  
    24  # ---
    25  # Stage 2: Final image with nothing but certs, binary, and default config file
    26  # ---
    27  FROM gcr.io/distroless/base-debian12 AS final
    28  ARG TARGETOS
    29  ARG TARGETARCH
    30  COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
    31  COPY --from=builder /go/src/github.com/project-zot/zot/bin/zot-$TARGETOS-$TARGETARCH /usr/bin/zot
    32  COPY --from=builder /go/src/github.com/project-zot/zot/config.json /etc/zot/config.json
    33  ENTRYPOINT ["/usr/bin/zot"]
    34  EXPOSE 5000
    35  VOLUME ["/var/lib/registry"]
    36  CMD ["serve", "/etc/zot/config.yaml"]