From 3ed4df61f88638294c3c15149091c97ff3ac0644 Mon Sep 17 00:00:00 2001 From: Christoph Ellrich Date: Wed, 9 Apr 2025 21:46:14 +0200 Subject: [PATCH] should work now --- Dockerfile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4b0598c..b082523 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,24 @@ -FROM alpine:3.19 +FROM alpine -RUN apk add --no-cache curl bash ca-certificates +ARG HELM_VERSION=3.2.1 +ARG KUBECTL_VERSION=1.17.5 -# Install kubectl -RUN sh -c 'curl -LO "https://dl.k8s.io/release/$(curl -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ - install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && rm kubectl' +# Determine architecture +RUN case `uname -m` in \ + x86_64) ARCH=amd64 ;; \ + armv7l) ARCH=arm ;; \ + aarch64) ARCH=arm64 ;; \ + ppc64le) ARCH=ppc64le ;; \ + s390x) ARCH=s390x ;; \ + *) echo "Unsupported arch" && exit 1 ;; \ + esac && echo "ARCH=$ARCH" > /envfile +# Install Helm and kubectl +RUN . /envfile && \ + apk add --no-cache curl ca-certificates bash && \ + curl -sL https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz | tar -xz && \ + mv linux-${ARCH}/helm /usr/bin/helm && chmod +x /usr/bin/helm && rm -rf linux-${ARCH} && \ + curl -sLO https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl && \ + mv kubectl /usr/bin/kubectl && chmod +x /usr/bin/kubectl -# Install Helm -RUN curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash - -ENTRYPOINT ["/bin/sh"] +WORKDIR /apps