-
Notifications
You must be signed in to change notification settings - Fork 404
Expand file tree
/
Copy pathDockerfile
More file actions
71 lines (58 loc) · 2.63 KB
/
Dockerfile
File metadata and controls
71 lines (58 loc) · 2.63 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ARG TERRAFORM_VERSION=1.14.4
RUN apt-get update && \
apt-get install -y --no-install-recommends software-properties-common gnupg && \
add-apt-repository ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y --no-install-recommends \
python3.12 \
git \
unzip \
curl \
vim \
apt-transport-https \
ca-certificates \
lsb-release && \
rm -rf /var/lib/apt/lists/*
# Install Terraform (detect architecture and install appropriate version)
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
curl -s https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_arm64.zip -o terraform.zip; \
else \
curl -s https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o terraform.zip; \
fi && \
unzip terraform.zip && \
mv terraform /usr/local/bin/ && \
rm -rf terraform.zip
# Install AWS CLI (detect architecture and install appropriate version)
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then \
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"; \
else \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; \
fi && \
unzip awscliv2.zip && \
./aws/install && \
rm -rf awscliv2.zip aws
# Install Azure CLI
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash
# Install Google Cloud SDK
RUN echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg && \
apt-get update && \
apt-get install -y google-cloud-cli && \
rm -rf /var/lib/apt/lists/*
RUN echo 'alias python=python3.12' >> ~/.bashrc
RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python3.12 get-pip.py && \
rm get-pip.py
RUN python3.12 -m pip install --upgrade setuptools wheel
RUN python3.12 -m pip install --upgrade pip
WORKDIR /attack_range
COPY . /attack_range
# Remove system-installed blinker package files to avoid uninstall conflict
RUN rm -rf /usr/lib/python3/dist-packages/blinker* /usr/local/lib/python3.12/dist-packages/blinker* 2>/dev/null || true
# Install all requirements
RUN python3.12 -m pip install --break-system-packages -r requirements.txt
ENTRYPOINT ["python3.12", "attack_range.py"]