forked from stefanprodan/podinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use tonistiigi/xx for multi-arch builds
Signed-off-by: Stefan Prodan <[email protected]>
- Loading branch information
1 parent
693ffa9
commit 0771a59
Showing
4 changed files
with
65 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
ARG XX_VERSION=1.0.0-rc.2 | ||
|
||
FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx | ||
|
||
FROM --platform=$BUILDPLATFORM golang:1.16-alpine as builder | ||
|
||
# Copy the build utilities. | ||
COPY --from=xx / / | ||
|
||
ARG TARGETPLATFORM | ||
ARG REVISION | ||
|
||
RUN mkdir -p /podinfo/ | ||
|
||
WORKDIR /podinfo | ||
|
||
COPY . . | ||
|
||
RUN go mod download | ||
|
||
ENV CGO_ENABLED=0 | ||
RUN xx-go build -ldflags "-s -w \ | ||
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \ | ||
-a -o bin/podinfo cmd/podinfo/* | ||
|
||
RUN xx-go build -ldflags "-s -w \ | ||
-X github.com/stefanprodan/podinfo/pkg/version.REVISION=${REVISION}" \ | ||
-a -o bin/podcli cmd/podcli/* | ||
|
||
FROM alpine:3.14 | ||
|
||
ARG BUILD_DATE | ||
ARG VERSION | ||
ARG REVISION | ||
|
||
LABEL maintainer="stefanprodan" | ||
|
||
RUN addgroup -S app \ | ||
&& adduser -S -G app app \ | ||
&& apk --no-cache add \ | ||
ca-certificates curl netcat-openbsd | ||
|
||
WORKDIR /home/app | ||
|
||
COPY --from=builder /podinfo/bin/podinfo . | ||
COPY --from=builder /podinfo/bin/podcli /usr/local/bin/podcli | ||
COPY ./ui ./ui | ||
RUN chown -R app:app ./ | ||
|
||
USER app | ||
|
||
CMD ["./podinfo"] |
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