-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
87 lines (74 loc) · 3.08 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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/ubuntu/.devcontainer/base.Dockerfile
# [Choice] Ubuntu version: bionic, focal
ARG VARIANT="focal"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
# [Optional] Uncomment this section to install additional OS packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get -y install --no-install-recommends \
build-essential \
dnsutils \
iputils-ping \
nmap \
python3-dev \
python3-venv \
software-properties-common \
tcpdump \
tmux \
traceroute \
vim
# Powershell Core & Az Modules
RUN \
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
apt-get update && export DEBIAN_FRONTEND=noninteractive && \
apt-get install -y powershell && \
add-apt-repository universe && \
pwsh -Command Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted && \
pwsh -Command "Set-Variable -Name 'ProgressPreference' -Value 'SilentlyContinue' && Install-Module -Name Az -AllowClobber" && \
rm packages-microsoft-prod.deb
# Terraform
RUN \
TF_VERSION=$(curl -s https://checkpoint-api.hashicorp.com/v1/check/terraform | jq -r -M ".current_version") && \
wget -nv -O terraform.zip https://releases.hashicorp.com/terraform/${TF_VERSION}/terraform_${TF_VERSION}_linux_amd64.zip && \
unzip terraform.zip && \
mv terraform /usr/local/bin && \
rm terraform.zip
# Pulumi
RUN \
curl -fsSL https://get.pulumi.com | sh && \
echo "export PATH=$PATH:/root/.pulumi/bin" >> /root/.bashrc
# AWS CLI
RUN \
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip -q awscliv2.zip && \
./aws/install && \
rm aws* -rf
# Azure CLI
RUN \
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null && \
AZ_REPO=$(lsb_release -cs) && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | tee /etc/apt/sources.list.d/azure-cli.list
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive && apt-get -y install \
azure-cli
# GitHub CLI
RUN \
export DEBIAN_FRONTEND=noninteractive && \
export APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn && \
apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0 && \
apt-add-repository https://cli.github.com/packages && \
apt-get update && \
apt-get -y install gh
# Create Python VENV and activate it
COPY requirements* /root/
RUN \
python3 -m venv /root/venv && \
. /root/venv/bin/activate && \
pip3 install --no-cache-dir -r /root/requirements-buildenv.txt && \
pip3 install --no-cache-dir -r /root/requirements.txt && \
pip3 install --no-cache-dir -r /root/venv/lib/python3.8/site-packages/ansible_collections/azure/azcollection/requirements-azure.txt
# Adjust .bashrc
RUN \
echo "source /root/venv/bin/activate" >> /root/.bashrc
# Install Ansible Collections
RUN \
. /root/venv/bin/activate && \
ansible-galaxy collection install -r /root/requirements.yml