Skip to content

Commit

Permalink
Specify the arch passed as build arg in the distroless image (kuberne…
Browse files Browse the repository at this point in the history
  • Loading branch information
Serializator committed Nov 3, 2021
1 parent 85a18b5 commit fef628b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# 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
ARG ARCH
ARG GIT_COMMIT
ARG GIT_TAG

RUN apt-get update && apt-get --no-install-recommends install -y libcap2-bin && apt-get clean && rm -rf /var/lib/apt/lists/*

Expand All @@ -13,13 +17,10 @@ COPY pkg pkg
COPY cmd cmd
COPY Makefile Makefile

ARG ARCH
ARG GIT_COMMIT
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 fef628b

Please sign in to comment.