Skip to content

Commit 9502296

Browse files
author
Alan Christie
committed
feat: Add kubectl & popeye
1 parent 580ca90 commit 9502296

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

Dockerfile

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
ARG DEV_PYTHON="3.13.5-slim"
22
FROM 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"
511
RUN 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
1219
ENV LANG=en_GB.UTF-8
1320
ENV 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
1625
RUN 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

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ The above creates an image with the following main components (amongst others):
1616
- Poetry (1.8)
1717
- Pre-Commit (4.2)
1818
- Ansible (11.8)
19+
- kubectl (1.31)
20+
- Popeye (0.22)
1921
- Docker-in-Docker
2022

2123
> Separate branches of this repository will be maintained
22-
for each active Major/Minor Python version in use. So you'll
23-
find a 3.13 branch for our Python 3.13 base container.
24+
for each active Major/Minor Python version used in our Projects.
25+
So you'll find a 3.13 branch for our Python 3.13 projects.
2426

2527
---
2628

0 commit comments

Comments
 (0)