-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
31 lines (28 loc) · 1.39 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM --platform=linux/amd64 python:3.11.3-bullseye
COPY entrypoint.sh /entrypoint.sh
RUN apt-get update -y && \
apt-get install -y bsdmainutils curl jq less unzip && \
adduser --disabled-password --gecos '' runner && \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install --update && \
rm -rf aws awscliv2.zip && \
TERRAFORM_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r .current_version) && \
curl https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip \
-o terraform.zip && \
unzip terraform.zip && \
mv terraform /usr/local/bin/ && \
rm terraform.zip && \
echo "export PATH=\$PATH:/home/runner/.local/bin" >> /home/runner/.bashrc
USER runner
WORKDIR /home/runner
RUN pip install --user ansible boto3 && \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y && \
. ${HOME}/.cargo/env && \
cargo install just
# For reasons unclear, the PATH environment variable does not get modified by
# the .bashrc when using the entrypoint script. Tried lots of different things.
# Therefore, we manually apply the paths we need.
ENV PATH=$PATH:/home/runner/.local/bin:/home/runner/.cargo/bin
WORKDIR /home/runner/sn_testnet_tool
ENTRYPOINT ["/entrypoint.sh"]