-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use docker buildx to create multi-arch image (#2)
- Loading branch information
1 parent
05cd593
commit 985fec7
Showing
3 changed files
with
75 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
FROM golang:1.14-alpine AS builder | ||
FROM --platform=${BUILDPLATFORM:-linux/amd64} tonistiigi/xx:golang AS xgo | ||
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.14-alpine AS builder | ||
COPY --from=xgo / / | ||
WORKDIR /app/ | ||
ADD . . | ||
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-w -s" -o kube-image-prefetch main.go | ||
RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o kube-image-prefetch main.go | ||
|
||
FROM scratch | ||
FROM --platform=${TARGETPLATFORM:-linux/amd64} scratch | ||
WORKDIR /app/ | ||
COPY --from=builder /app/kube-image-prefetch /app/kube-image-prefetch | ||
ENTRYPOINT ["/app/kube-image-prefetch"] |
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