Skip to content

Commit

Permalink
Specify the arch passed as build arg in the distroless image (#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
Serializator authored and serathius committed Nov 16, 2021
1 parent 2a51be1 commit 232299f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Update the base image in Makefile when updating golang version. This has to
# be pre-pulled in order to work on GCB.
ARG ARCH
FROM golang:1.16.8 as build

WORKDIR /go/src/sigs.k8s.io/metrics-server
Expand All @@ -16,7 +17,7 @@ ARG GIT_COMMIT
ARG GIT_TAG
RUN make metrics-server

FROM gcr.io/distroless/static:latest
FROM gcr.io/distroless/static:latest-$ARCH
COPY --from=build /go/src/sigs.k8s.io/metrics-server/metrics-server /
USER 65534
ENTRYPOINT ["/metrics-server"]
1 change: 1 addition & 0 deletions skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build:
docker:
dockerfile: Dockerfile
buildArgs:
ARCH: "amd64"
GIT_TAG: "devel"
deploy:
kustomize:
Expand Down

0 comments on commit 232299f

Please sign in to comment.