-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use stacker to build OCI image. Use podman/docker to build docker image. Signed-off-by: Ramkumar Chinchani <[email protected]>
- Loading branch information
Showing
7 changed files
with
57 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
# --- | ||
# Stage 1: Install certs, build binary, create default config file | ||
# --- | ||
FROM ghcr.io/project-zot/golang:1.20 AS builder | ||
FROM --platform=$BUILDPLATFORM ghcr.io/project-zot/golang:1.20 AS builder | ||
|
||
ARG TARGETOS | ||
ARG TARGETARCH | ||
ARG COMMIT | ||
ARG OS | ||
ARG ARCH | ||
|
||
RUN mkdir -p /go/src/github.com/project-zot/zot | ||
WORKDIR /go/src/github.com/project-zot/zot | ||
COPY . . | ||
RUN make COMMIT=$COMMIT OS=$OS ARCH=$ARCH clean bench | ||
RUN make COMMIT=$COMMIT OS=$TARGETOS ARCH=$TARGETARCH clean bench | ||
|
||
# --- | ||
# Stage 2: Final image with nothing but certs, binary, and default config file | ||
# --- | ||
FROM gcr.io/distroless/base AS final | ||
ARG OS | ||
ARG ARCH | ||
COPY --from=builder /go/src/github.com/project-zot/zot/bin/zb-$OS-$ARCH /usr/bin/zb | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
COPY --from=builder /go/src/github.com/project-zot/zot/bin/zb-$TARGETOS-$TARGETARCH /usr/bin/zb | ||
ENTRYPOINT ["/usr/bin/zb"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters