11ARG DEV_PYTHON="3.13.5-slim"
22FROM python:${DEV_PYTHON}
33
4+ # The target platform.
5+ # Some tool installations (like kubectl) need to know whether we're AMD or ARM
6+ # The value will be the platform value used in the build ("linux/amd64" or "linux/arm64")
7+ ARG TARGETPLATFORM
8+ ENV TARGETPLATFORM=${TARGETPLATFORM}
9+
410# To fix "unsupported locale"
511RUN apt-get update && \
612 apt-get install -y locales && \
@@ -9,12 +15,32 @@ RUN apt-get update && \
915 locale-gen && \
1016 dpkg-reconfigure --frontend=noninteractive locales
1117
18+ ENV LANGUAGE=en_GB.UTF-8
1219ENV LANG=en_GB.UTF-8
1320ENV LC_ALL=en_GB.UTF-8
1421
15- # Install other stuff
22+ # Install our python requirements, kubectl
23+ ARG KUBECTL_VERSION=1.31.11
24+ COPY requirements.txt /tmp
1625RUN apt-get update && \
1726 apt-get install -y --no-install-recommends \
18- git
19- COPY requirements.txt /tmp
20- RUN pip install -r /tmp/requirements.txt
27+ curl \
28+ git \
29+ wget && \
30+ pip install -r /tmp/requirements.txt && \
31+ curl -LO https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/${TARGETPLATFORM}/kubectl && \
32+ install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
33+ rm kubectl
34+ # Popeye
35+ ARG POPEYE_VERSION=0.22.1
36+ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
37+ wget https://github.com/derailed/popeye/releases/download/v${POPEYE_VERSION}/popeye_linux_arm64.tar.gz && \
38+ tar -xf popeye_linux_arm64.tar.gz; \
39+ elif [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
40+ wget https://github.com/derailed/popeye/releases/download/v${POPEYE_VERSION}/popeye_linux_amd64.tar.gz && \
41+ tar -xf popeye_linux_arm64.tar.gz; \
42+ else \
43+ exit 112; \
44+ fi && \
45+ mv popeye /usr/local/bin && \
46+ rm LICENSE README.md
0 commit comments