Skip to content

Commit 3467b48

Browse files
committed
chore(dockerfile): Use existing TARGETPLATFORM arg
1 parent d2ae1e3 commit 3467b48

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

Dockerfile

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,31 @@
11
FROM python:3.12-slim
22

3+
ARG TARGETPLATFORM
4+
35
##
46
## Install kubectl and dependencies.
57
##
68
ENV KUBE_LATEST_VERSION="v1.21.3"
79
ENV HELM_VERSION="v3.6.2" \
810
VIRTUAL_ENV="/app/.venv" \
911
PATH="/app/.venv/bin:$PATH"
10-
ENV TARGETARCH=""
12+
1113

1214
RUN apt-get update \
1315
&& apt-get install wget ca-certificates bash git git-crypt -y --no-install-recommends \
14-
# Determine target architecture and set TARGETARCH accordingly
15-
&& case "$(dpkg --print-architecture)" in \
16-
amd64) export TARGETARCH="amd64" ;; \
17-
arm64) export TARGETARCH="arm64" ;; \
18-
*) echo "Unsupported architecture: $(dpkg --print-architecture)"; exit 1 ;; \
19-
esac \
20-
\
2116
# Download kubectl
22-
&& wget -q https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/${TARGETARCH}/kubectl -O /usr/local/bin/kubectl \
17+
&& wget -q https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/${TARGETPLATFORM}/kubectl -O /usr/local/bin/kubectl \
2318
&& chmod +x /usr/local/bin/kubectl \
2419
\
2520
# Download helm
26-
&& wget -q https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz -O - | tar -xzO linux-${TARGETARCH}/helm > /usr/local/bin/helm \
21+
&& wget -q https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETPLATFORM}.tar.gz -O - | tar -xzO linux-${TARGETPLATFORM}/helm > /usr/local/bin/helm \
2722
&& chmod +x /usr/local/bin/helm \
2823
\
2924
# Install helm-secrets plugin
3025
&& helm plugin install https://github.com/jkroepke/helm-secrets --version v4.2.2 \
3126
\
3227
# Download sops
33-
&& wget -q https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.${TARGETARCH} -O /usr/local/bin/sops \
28+
&& wget -q https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.${TARGETPLATFORM} -O /usr/local/bin/sops \
3429
&& chmod +x /usr/local/bin/sops \
3530
\
3631
&& apt-get clean \

0 commit comments

Comments
 (0)