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 committed Nov 3, 2021
1 parent 85a18b5 commit c202e49
Showing 1 changed file with 2 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.17.1 as build

RUN apt-get update && apt-get --no-install-recommends install -y libcap2-bin && apt-get clean && rm -rf /var/lib/apt/lists/*
Expand All @@ -19,7 +20,7 @@ ARG GIT_TAG
RUN make metrics-server
RUN setcap cap_net_bind_service=+ep 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"]

0 comments on commit c202e49

Please sign in to comment.