11FROM python:3.12-slim
22
3+ ARG TARGETARCH
4+
35# #
46# # Install kubectl and dependencies.
57# #
6- # RUN apk add -U openssl curl tar gzip bash ca-certificates && \
7- # wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub && \
8- # wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-2.23-r3.apk && \
9- # apk add glibc-2.23-r3.apk && \
10- # rm glibc-2.23-r3.apk
11- # RUN curl -L -o /usr/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/v1.8.0/bin/linux/amd64/kubectl && \
12- # chmod +x /usr/bin/kubectl && \
13- # kubectl version --client
148ENV KUBE_LATEST_VERSION="v1.21.3"
159ENV HELM_VERSION="v3.6.2" \
1610 VIRTUAL_ENV="/app/.venv" \
1711 PATH="/app/.venv/bin:$PATH"
18- RUN apt-get update
19- RUN apt-get install wget ca-certificates bash git git-crypt -y --no-install-recommends \
20- && wget -q https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl \
12+
13+
14+ RUN apt-get update \
15+ && apt-get install wget ca-certificates bash git git-crypt -y --no-install-recommends \
16+ # Download kubectl
17+ && wget -q https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/${TARGETARCH}/kubectl -O /usr/local/bin/kubectl \
2118 && chmod +x /usr/local/bin/kubectl \
22- && wget -q https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm \
19+ \
20+ # Download helm
21+ && wget -q https://get.helm.sh/helm-${HELM_VERSION}-linux-${TARGETARCH}.tar.gz -O - | tar -xzO linux-${TARGETARCH}/helm > /usr/local/bin/helm \
2322 && chmod +x /usr/local/bin/helm \
23+ \
24+ # Install helm-secrets plugin
2425 && helm plugin install https://github.com/jkroepke/helm-secrets --version v4.2.2 \
25- && wget -q https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.amd64 -O /usr/local/bin/sops \
26+ \
27+ # Download sops
28+ && wget -q https://github.com/mozilla/sops/releases/download/v3.7.3/sops-v3.7.3.linux.${TARGETARCH} -O /usr/local/bin/sops \
2629 && chmod +x /usr/local/bin/sops \
30+ \
2731 && apt-get clean \
2832 && apt-get -y autoremove \
2933 && rm -rf /var/lib/apt/lists/* \
30- && rm -rf /var/cache/apt/ \
31- ENV SHELL=/bin/bash
34+ && rm -rf /var/cache/apt/
35+
36+ ENV SHELL=/bin/bash
3237
3338# #
3439# # Install dependencies and copy GitOps server.
@@ -49,5 +54,4 @@ ENV GIT_CRYPT_KEY_FILE=/app/cluster.key
4954ENV PYTHONPATH="$PYTHONPATH:/app"
5055ENV ACCESS_LOG=""
5156
52-
53- CMD ["uvicorn" , "--host" , "0.0.0.0" , "--port" , "8000" , "gitops_server.main:app" ]
57+ CMD ["uvicorn" , "--host" , "0.0.0.0" , "--port" , "8000" , "gitops_server.main:app" ]
0 commit comments