Skip to content

Commit

Permalink
feat(docker): use distroless base image
Browse files Browse the repository at this point in the history
  • Loading branch information
Pietro Terrizzi authored and prometherion committed Nov 21, 2022
1 parent 39cba3b commit d29257c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Dockerfile.distroless
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Download-STAGE
FROM alpine:3.16.2 as downloader

ARG KUBECTL_VERSION
ARG TARGETARCH

RUN echo -e "-----------------\nKubectl: ${KUBECTL_VERSION}\nArch: ${TARGETARCH}\n-----------------\n"
RUN apk add --no-cache -U -u \
ca-certificates \
curl
RUN curl -L -o /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VERSION}/bin/linux/${TARGETARCH}/kubectl && \
chmod +x /usr/local/bin/kubectl

# Run-STAGE
FROM gcr.io/distroless/static-debian11:nonroot

WORKDIR /
COPY --from=downloader /usr/local/bin/kubectl .

ENTRYPOINT ["/kubectl"]

0 comments on commit d29257c

Please sign in to comment.