1- FROM ubuntu:20.04
1+ FROM ubuntu:20.04 AS aliyun
22LABEL maintainer="HuoCorp research lab <https://github.com/HuoCorp>"
3+ COPY . /TerraformGoat
4+ RUN apt-get update -y && \
5+ apt-get -yq --no-install-recommends install gnupg2 groff less lsb-release software-properties-common curl vim && \
6+ curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - 2>/dev/null && \
7+ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
8+ apt-get update && \
9+ apt-get -yq --no-install-recommends install terraform && \
10+ apt-get clean && \
11+ apt-get autoclean && \
12+ echo "plugin_cache_dir = \" $HOME/.terraform.d/plugin-cache\" " > ~/.terraformrc && \
13+ mkdir -p $HOME/.terraform.d/plugin-cache && \
14+ cd /TerraformGoat/aliyun/oss/bucket_http_enable && terraform init && \
15+ curl -O "https://aliyuncli.alicdn.com/aliyun-cli-linux-3.0.32-amd64.tgz" && \
16+ tar xzvf aliyun-cli-linux-3.0.32-amd64.tgz && \
17+ cp aliyun /usr/local/bin && \
18+ echo "bash init.sh" >> ~/.bashrc
19+ WORKDIR /TerraformGoat
20+
21+ FROM ubuntu:20.04 AS tencentcloud
22+ LABEL maintainer="HuoCorp research lab <https://github.com/HuoCorp>"
23+ COPY . /TerraformGoat
24+ RUN apt-get update -y && \
25+ apt-get -yq --no-install-recommends install curl gnupg2 groff less lsb-release python3-pip software-properties-common vim && \
26+ curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - 2>/dev/null && \
27+ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
28+ apt-get update && \
29+ apt-get -yq --no-install-recommends install terraform && \
30+ apt-get clean && \
31+ apt-get autoclean && \
32+ echo "plugin_cache_dir = \" $HOME/.terraform.d/plugin-cache\" " > ~/.terraformrc && \
33+ mkdir -p $HOME/.terraform.d/plugin-cache && \
34+ cd /TerraformGoat/tencentcloud/cos/bucket_acl_readable && terraform init && \
35+ pip install tccli && \
36+ echo "bash init.sh" >> ~/.bashrc
37+ WORKDIR /TerraformGoat
338
39+ FROM ubuntu:20.04 AS huaweicloud
40+ LABEL maintainer="HuoCorp research lab <https://github.com/HuoCorp>"
41+ COPY . /TerraformGoat
442RUN apt-get update -y && \
5- apt-get install -qy gnupg2 && \
6- apt-get install -qy curl && \
7- apt-get install -qy vim && \
8- apt-get install -qy lsb-release && \
9- apt-get install -qy software-properties-common && \
10- apt-get install -y -qq less && \
11- apt-get install -y -qq groff && \
43+ apt-get -yq --no-install-recommends install gnupg2 groff less lsb-release software-properties-common curl vim && \
1244 curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - 2>/dev/null && \
1345 apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
1446 apt-get update && \
15- apt-get install terraform && \
47+ apt-get -yq --no-install-recommends install terraform && \
48+ apt-get clean && \
49+ apt-get autoclean && \
1650 echo "plugin_cache_dir = \" $HOME/.terraform.d/plugin-cache\" " > ~/.terraformrc && \
1751 mkdir -p $HOME/.terraform.d/plugin-cache && \
18- echo "bash install_cloud_cli.sh " >> ~/.bashrc
52+ cd /TerraformGoat/huaweicloud/obs/bucket_object_traversal && terraform init && \
53+ curl -sSL https://hwcloudcli.obs.cn-north-1.myhuaweicloud.com/cli/latest/hcloud_install.sh -o ./hcloud_install.sh && echo "y" | bash ./hcloud_install.sh -y && \
54+ echo "bash init.sh" >> ~/.bashrc
55+ WORKDIR /TerraformGoat
1956
57+ FROM ubuntu:20.04 AS aws
58+ LABEL maintainer="HuoCorp research lab <https://github.com/HuoCorp>"
2059COPY . /TerraformGoat
60+ RUN apt-get update -y && \
61+ apt-get -yq --no-install-recommends install gnupg2 groff less lsb-release software-properties-common curl unzip vim && \
62+ curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - 2>/dev/null && \
63+ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
64+ apt-get update && \
65+ apt-get -yq --no-install-recommends install terraform && \
66+ apt-get clean && \
67+ apt-get autoclean && \
68+ echo "plugin_cache_dir = \" $HOME/.terraform.d/plugin-cache\" " > ~/.terraformrc && \
69+ mkdir -p $HOME/.terraform.d/plugin-cache && \
70+ cd /TerraformGoat/aws/s3/bucket_acl_readable && terraform init && \
71+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
72+ unzip awscliv2.zip && \
73+ ./aws/install && \
74+ echo "bash init.sh" >> ~/.bashrc
75+ WORKDIR /TerraformGoat
76+
77+ FROM ubuntu:20.04 AS gcp
78+ LABEL maintainer="HuoCorp research lab <https://github.com/HuoCorp>"
79+ COPY . /TerraformGoat
80+ RUN apt-get update -y && \
81+ apt-get -yq --no-install-recommends install gnupg2 groff less lsb-release software-properties-common curl vim && \
82+ curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - 2>/dev/null && \
83+ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
84+ apt-get update && \
85+ apt-get -yq --no-install-recommends install terraform && \
86+ apt-get clean && \
87+ apt-get autoclean && \
88+ echo "plugin_cache_dir = \" $HOME/.terraform.d/plugin-cache\" " > ~/.terraformrc && \
89+ mkdir -p $HOME/.terraform.d/plugin-cache && \
90+ cd /TerraformGoat/gcp/cs/bucket_acl_writable && terraform init && \
91+ curl -O "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-377.0.0-linux-x86_64.tar.gz" && \
92+ tar -xf google-cloud-sdk-377.0.0-linux-x86_64.tar.gz && \
93+ N y /root/.bashrc | ./google-cloud-sdk/install.sh && \
94+ echo "bash init.sh" >> ~/.bashrc
95+ WORKDIR /TerraformGoat
96+
97+ FROM ubuntu:20.04 AS azure
98+ LABEL maintainer="HuoCorp research lab <https://github.com/HuoCorp>"
99+ COPY . /TerraformGoat
100+ RUN apt-get update -y && \
101+ apt-get -yq --no-install-recommends install gnupg2 groff less lsb-release software-properties-common curl vim && \
102+ curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - 2>/dev/null && \
103+ apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && \
104+ apt-get update && \
105+ apt-get -yq --no-install-recommends install terraform && \
106+ apt-get clean && \
107+ apt-get autoclean && \
108+ echo "plugin_cache_dir = \" $HOME/.terraform.d/plugin-cache\" " > ~/.terraformrc && \
109+ mkdir -p $HOME/.terraform.d/plugin-cache && \
110+ cd /TerraformGoat/azure/blob/blob_public_access && terraform init && \
111+ curl -sL https://aka.ms/InstallAzureCLIDeb | bash && \
112+ echo "bash init.sh" >> ~/.bashrc
21113WORKDIR /TerraformGoat
0 commit comments