Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
fix kubectl arch
  • Loading branch information
camaeel authored May 16, 2023
1 parent 479d7fa commit 75f35b9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions kubectl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
FROM alpine:latest

ARG KUBECTL_VERSION=1.25.8

USER root

RUN set -eux; \
ARCH="$(uname -i)"; \
case "${ARCH}" in \
aarch64|arm64) \
wget "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/arm64/kubectl" && \
echo "$(wget -O - "https://dl.k8s.io/v${KUBECTL_VERSION}/bin/linux/arm64/kubectl.sha256") kubectl" > kubectl.sha256 && \
sha256sum -cw kubectl.sha256 && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
rm kubectl
;; \
amd64|x86_64) \
wget "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
echo "$(wget -O - "https://dl.k8s.io/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256") kubectl" > kubectl.sha256 && \
sha256sum -cw kubectl.sha256 && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
rm kubectl
;; \
*) \
echo "Unsupported arch: ${ARCH}"; \
exit 1; \
;; \
esac; \

RUN wget "https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && \
echo "$(wget -O - "https://dl.k8s.io/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl.sha256") kubectl" > kubectl.sha256 && \
sha256sum -cw kubectl.sha256 && \
Expand Down

0 comments on commit 75f35b9

Please sign in to comment.