Skip to content

Commit 8e95b0b

Browse files
committed
Update container definitions
* Update outdated dependencies * Split installation into multiple steps to aid debugging * Remove replace ';' with '&&' to fail properly when anything fails
1 parent 18d37b2 commit 8e95b0b

File tree

4 files changed

+64
-45
lines changed

4 files changed

+64
-45
lines changed

client/container_preparation/Dockerfile

+20-18
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
ARG BUILDPLATFORM=linux/amd64
33
FROM --platform=$BUILDPLATFORM python:3.9-alpine
44

5-
6-
7-
# Add rust binaries to PATH
8-
ENV PATH="$PATH:/root/.cargo/bin"
9-
105
# Create code directory, output directory
116
RUN mkdir /container_preparation /output
127

@@ -19,22 +14,29 @@ COPY ./utils /container_preparation/utils
1914
# Set workdir
2015
WORKDIR /container_preparation
2116

22-
# Install necessary packages, spire-agent and rust
17+
# Install necessary packages
2318
RUN apk add --no-cache \
24-
git=2.43.0-r0 \
25-
curl=8.5.0-r0 \
19+
git=2.45.2-r0 \
20+
curl=8.11.0-r2 \
2621
jq=1.7.1-r0 \
2722
build-base=0.5-r3 \
28-
libffi-dev=3.4.4-r3 && \
29-
curl -LsSf -o spire-1.9.0-linux-amd64-musl.tar.gz https://github.com/spiffe/spire/releases/download/v1.9.0/spire-1.9.0-linux-amd64-musl.tar.gz && \
30-
tar xvf spire-1.9.0-linux-amd64-musl.tar.gz ; mv spire-1.9.0 /opt ; mv /opt/spire-1.9.0 /opt/spire && \
31-
ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent && \
32-
ln -s /opt/spire/bin/spire-server /usr/bin/spire-server && \
33-
rm -rf spire-1.9.0-linux-amd64-musl.tar.gz && \
34-
curl https://sh.rustup.rs -sSf -o rustup.sh ; chmod +x rustup.sh ; ./rustup.sh -y ; export PATH="$PATH":/root/.cargo/bin && \
35-
pip install --no-cache-dir -r ./requirements.txt && \
36-
pip install --no-cache-dir git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8 && \
37-
rm -r /root/.cargo /root/.rustup
23+
libffi-dev=3.4.6-r0
24+
# Install spire-agent
25+
RUN curl -LsSf -o spire-1.9.0-linux-amd64-musl.tar.gz https://github.com/spiffe/spire/releases/download/v1.9.0/spire-1.9.0-linux-amd64-musl.tar.gz && \
26+
tar xvf spire-1.9.0-linux-amd64-musl.tar.gz && \
27+
mv spire-1.9.0 /opt && \
28+
mv /opt/spire-1.9.0 /opt/spire && \
29+
ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent && \
30+
ln -s /opt/spire/bin/spire-server /usr/bin/spire-server && \
31+
rm -rf spire-1.9.0-linux-amd64-musl.tar.gz
32+
# Install python things (and rust temporarily)
33+
RUN curl https://sh.rustup.rs -sSf -o rustup.sh && \
34+
chmod +x rustup.sh && \
35+
./rustup.sh -y && \
36+
export PATH="$PATH:/root/.cargo/bin" && \
37+
pip install --no-cache-dir -r ./requirements.txt && \
38+
pip install --no-cache-dir git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8 && \
39+
rm -r /root/.cargo /root/.rustup
3840

3941
# Set entrypoint
4042
ENTRYPOINT [ "./entrypoint.sh" ]

client/data_preparation/Dockerfile

+20-13
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,29 @@ COPY ./utils /data_preparation/utils
1414
# Set workdir
1515
WORKDIR /data_preparation
1616

17-
# Install necessary packages, spire-agent and rust
17+
# Install necessary packages
1818
RUN apk add --no-cache \
19-
git=2.43.0-r0 \
20-
curl=8.5.0-r0 \
19+
git=2.45.2-r0 \
20+
curl=8.11.0-r2 \
2121
jq=1.7.1-r0 \
2222
build-base=0.5-r3 \
23-
libffi-dev=3.4.4-r3 && \
24-
curl -LsSf -o spire-1.9.0-linux-amd64-musl.tar.gz https://github.com/spiffe/spire/releases/download/v1.9.0/spire-1.9.0-linux-amd64-musl.tar.gz && \
25-
tar xvf spire-1.9.0-linux-amd64-musl.tar.gz ; mv spire-1.9.0 /opt ; mv /opt/spire-1.9.0 /opt/spire && \
26-
ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent && \
27-
ln -s /opt/spire/bin/spire-server /usr/bin/spire-server && \
28-
rm -rf spire-1.9.0-linux-amd64-musl.tar.gz && \
29-
curl https://sh.rustup.rs -sSf -o rustup.sh ; chmod +x rustup.sh ; ./rustup.sh -y ; export PATH="$PATH":/root/.cargo/bin && \
30-
pip install --no-cache-dir -r ./requirements.txt && \
31-
pip install --no-cache-dir git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8 && \
32-
rm -r /root/.cargo /root/.rustup
23+
libffi-dev=3.4.6-r0
24+
# Install spire-agent
25+
RUN curl -LsSf -o spire-1.9.0-linux-amd64-musl.tar.gz https://github.com/spiffe/spire/releases/download/v1.9.0/spire-1.9.0-linux-amd64-musl.tar.gz && \
26+
tar xvf spire-1.9.0-linux-amd64-musl.tar.gz && \
27+
mv spire-1.9.0 /opt && \
28+
mv /opt/spire-1.9.0 /opt/spire && \
29+
ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent && \
30+
ln -s /opt/spire/bin/spire-server /usr/bin/spire-server && \
31+
rm -rf spire-1.9.0-linux-amd64-musl.tar.gz
32+
# Install python things (and rust temporarily)
33+
RUN curl https://sh.rustup.rs -sSf -o rustup.sh && \
34+
chmod +x rustup.sh && \
35+
./rustup.sh -y && \
36+
export PATH="$PATH:/root/.cargo/bin" && \
37+
pip install --no-cache-dir -r ./requirements.txt && \
38+
pip install --no-cache-dir git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8 && \
39+
rm -r /root/.cargo /root/.rustup
3340

3441
# Set entrypoint
3542
ENTRYPOINT [ "./entrypoint.sh" ]

client/job_preparation/Dockerfile

+12-6
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ WORKDIR /job_preparation
1111
# Copy utils for SPIFFEID creation ...
1212
COPY ./utils /job_preparation/utils
1313

14-
# Install necessary packages and rust
14+
# Install necessary packages
1515
RUN apk add --no-cache \
16-
curl=8.5.0-r0 \
16+
git=2.45.2-r0 \
17+
curl=8.11.0-r2 \
18+
jq=1.7.1-r0 \
1719
build-base=0.5-r3 \
18-
libffi-dev=3.4.4-r3 && \
19-
curl https://sh.rustup.rs -sSf -o rustup.sh ; chmod +x rustup.sh ; ./rustup.sh -y ; export PATH="$PATH":/root/.cargo/bin && \
20-
pip install --no-cache-dir -r ./requirements.txt && \
21-
rm -r /root/.cargo /root/.rustup
20+
libffi-dev=3.4.6-r0
21+
# Install python things (and rust temporarily)
22+
RUN curl https://sh.rustup.rs -sSf -o rustup.sh && \
23+
chmod +x rustup.sh && \
24+
./rustup.sh -y && \
25+
export PATH="$PATH:/root/.cargo/bin" && \
26+
pip install --no-cache-dir -r ./requirements.txt && \
27+
rm -r /root/.cargo /root/.rustup
2228

2329
# Set entrypoint
2430
ENTRYPOINT [ "python3", "./prepare_job.py" ]

server/Dockerfile

+12-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ FROM --platform=$BUILDPLATFORM python:3.9-alpine
44

55
# Install necessary packages and spire-agent
66
RUN apk add --no-cache \
7-
git=2.43.0-r0 \
7+
git=2.45.2-r0 \
8+
curl=8.11.0-r2 \
89
build-base=0.5-r3 \
9-
openssl=3.1.4-r5 && \
10-
wget -q https://github.com/spiffe/spire/releases/download/v1.9.0/spire-1.9.0-linux-amd64-musl.tar.gz && \
11-
tar xvf spire-1.9.0-linux-amd64-musl.tar.gz ; mv spire-1.9.0 /opt ; mv /opt/spire-1.9.0 /opt/spire && \
12-
ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent && \
13-
ln -s /opt/spire/bin/spire-server /usr/bin/spire-server && \
14-
rm -rf spire-1.9.0-linux-amd64-musl.tar.gz
10+
openssl=3.3.2-r1
11+
# Install spire-agent
12+
RUN curl -LsSf -o spire-1.9.0-linux-amd64-musl.tar.gz https://github.com/spiffe/spire/releases/download/v1.9.0/spire-1.9.0-linux-amd64-musl.tar.gz && \
13+
tar xvf spire-1.9.0-linux-amd64-musl.tar.gz && \
14+
mv spire-1.9.0 /opt && \
15+
mv /opt/spire-1.9.0 /opt/spire && \
16+
ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent && \
17+
ln -s /opt/spire/bin/spire-server /usr/bin/spire-server && \
18+
rm -rf spire-1.9.0-linux-amd64-musl.tar.gz
1519

1620
# Copy server
1721
COPY ./server /server
@@ -21,7 +25,7 @@ WORKDIR /server
2125

2226
# Install dependencies
2327
RUN pip install --no-cache-dir -r ./requirements.txt && \
24-
pip install --no-cache-dir git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8
28+
pip install --no-cache-dir git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8
2529

2630
# Copy utils
2731
COPY ./utils /server/utils

0 commit comments

Comments
 (0)