-
Notifications
You must be signed in to change notification settings - Fork 99
/
Dockerfile
26 lines (20 loc) · 867 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
FROM alpine
LABEL maintainer="Lachlan Evenson <lachlan.evenson@gmail.com>"
ARG VCS_REF
ARG BUILD_DATE
# Metadata
LABEL org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/lachie83/k8s-kubectl" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.docker.dockerfile="/Dockerfile"
ENV KUBE_LATEST_VERSION="v1.23.14"
RUN apk add --update ca-certificates \
&& apk add -t deps \
&& apk add --update curl \
&& export ARCH="$(uname -m)" && if [[ ${ARCH} == "x86_64" ]]; then export ARCH="amd64"; elif [[ ${ARCH} == "aarch64" ]]; then export ARCH="arm64"; fi && curl -L https://dl.k8s.io/release/${KUBE_LATEST_VERSION}/bin/linux/${ARCH}/kubectl -o /usr/local/bin/kubectl \
&& chmod +x /usr/local/bin/kubectl \
&& apk del --purge deps \
&& rm /var/cache/apk/*
WORKDIR /root
ENTRYPOINT ["kubectl"]
CMD ["help"]