|
1 | 1 | # Using Python original Docker image
|
2 |
| -FROM --platform=linux/amd64 python:3.9-alpine |
3 |
| - |
4 |
| -# Install necessary packages |
5 |
| -RUN apk add \ |
6 |
| - git \ |
7 |
| - curl \ |
8 |
| - jq \ |
9 |
| - build-base \ |
10 |
| - libffi-dev |
11 |
| - |
12 |
| -RUN curl https://sh.rustup.rs -sSf -o rustup.sh ; chmod +x rustup.sh ; ./rustup.sh -y |
| 2 | +ARG BUILDPLATFORM=linux/amd64 |
| 3 | +FROM --platform=$BUILDPLATFORM python:3.9-alpine |
| 4 | + |
| 5 | +# Install necessary packages, spire-agent and rust |
| 6 | +RUN apk add --no-cache \ |
| 7 | + git=2.43.0-r0 \ |
| 8 | + curl=8.5.0-r0 \ |
| 9 | + jq=1.7.1-r0 \ |
| 10 | + build-base=0.5-r3 \ |
| 11 | + libffi-dev=3.4.4-r3 && \ |
| 12 | +curl -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 ; mv spire-1.9.0 /opt ; mv /opt/spire-1.9.0 /opt/spire && \ |
| 14 | +ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent && \ |
| 15 | +ln -s /opt/spire/bin/spire-server /usr/bin/spire-server && \ |
| 16 | +rm -rf spire-1.9.0-linux-amd64-musl.tar.gz && \ |
| 17 | +curl https://sh.rustup.rs -sSf -o rustup.sh ; chmod +x rustup.sh ; ./rustup.sh -y |
| 18 | + |
| 19 | +# Add rust binaries to PATH |
13 | 20 | ENV PATH="$PATH:/root/.cargo/bin"
|
14 | 21 |
|
15 |
| -# Install spire-agent |
16 |
| -RUN wget -q https://github.com/spiffe/spire/releases/download/v1.9.1/spire-1.9.1-linux-amd64-musl.tar.gz |
17 |
| -RUN tar xvf spire-1.9.1-linux-amd64-musl.tar.gz ; mv spire-1.9.1 /opt ; mv /opt/spire-1.9.1 /opt/spire |
18 |
| -RUN ln -s /opt/spire/bin/spire-agent /usr/bin/spire-agent |
19 |
| - |
20 |
| -# Install pyspiffe package |
21 |
| -RUN pip install git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8 |
22 |
| - |
23 | 22 | # Create code directory, output directory
|
24 |
| -RUN mkdir /container_preparation /output ; chmod -R 777 /output |
| 23 | +RUN mkdir /container_preparation /output |
25 | 24 |
|
26 | 25 | # Copy useful data from the project
|
27 | 26 | COPY ./client/container_preparation /container_preparation
|
28 | 27 |
|
| 28 | +# Set workdir |
| 29 | +WORKDIR /container_preparation |
| 30 | + |
29 | 31 | # Install dependencies
|
30 |
| -RUN cd /container_preparation && pip install -r ./requirements.txt |
| 32 | +RUN pip install --no-cache-dir -r ./requirements.txt && \ |
| 33 | +pip install --no-cache-dir git+https://github.com/HewlettPackard/py-spiffe.git@3640af9d6629c05e027f99010abc934cb74122a8 |
31 | 34 |
|
32 | 35 | # Copy utils for SPIFFEID creation ...
|
33 | 36 | COPY ./utils /container_preparation/utils
|
34 | 37 |
|
35 |
| -# Set workdir |
36 |
| -WORKDIR /container_preparation |
37 |
| - |
38 | 38 | # Set entrypoint
|
39 | 39 | ENTRYPOINT [ "./entrypoint.sh" ]
|
0 commit comments