-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
121 lines (98 loc) · 4.19 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
FROM python:latest
# Docker Repository
RUN install -m 0755 -d /etc/apt/keyrings
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
RUN chmod a+r /etc/apt/keyrings/docker.gpg
RUN echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
# NodeJS Repository
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add -
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
# Repository Installation Preparation
RUN apt-get update && apt-get install -y gnupg software-properties-common && apt-get clean && rm -rf /var/lib/apt/lists/*
#Terraform Repository
RUN wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null
RUN gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint
RUN echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] \
https://apt.releases.hashicorp.com $(lsb_release -cs) main" | \
tee /etc/apt/sources.list.d/hashicorp.list
# OpenTofu Repository
RUN install -m 0755 -d /etc/apt/keyrings
RUN curl -fsSL https://get.opentofu.org/opentofu.gpg | tee /etc/apt/keyrings/opentofu.gpg >/dev/null
RUN curl -fsSL https://packages.opentofu.org/opentofu/tofu/gpgkey | gpg --no-tty --batch --dearmor -o /etc/apt/keyrings/opentofu-repo.gpg >/dev/null
RUN chmod a+r /etc/apt/keyrings/opentofu.gpg
RUN echo \
"deb [signed-by=/etc/apt/keyrings/opentofu.gpg,/etc/apt/keyrings/opentofu-repo.gpg] https://packages.opentofu.org/opentofu/tofu/any/ any main \
deb-src [signed-by=/etc/apt/keyrings/opentofu.gpg,/etc/apt/keyrings/opentofu-repo.gpg] https://packages.opentofu.org/opentofu/tofu/any/ any main" | \
tee /etc/apt/sources.list.d/opentofu.list > /dev/null
# Docker Repository
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
RUN apt-key fingerprint 0EBFCD88
RUN add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
RUN apt-get update && apt-get install -y \
apt-transport-https \
bash \
coreutils \
curl \
git \
groff \
jq \
less \
make \
python3 \
tar \
unzip \
wget \
zip \
ca-certificates \
gnupg-agent \
software-properties-common \
vim \
vim-tiny \
autojump \
netcat-openbsd \
tig \
dnsutils \
sslscan \
shellcheck \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
nodejs \
tofu \
terraform \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# AWS and Python Tooling
RUN python -m ensurepip --upgrade
RUN pip3 install --upgrade pip awscli virtualenv aws-cdk-lib
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && rm awscliv2.zip && rm -fr ./aws
RUN wget https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_$(if [ $(dpkg --print-architecture) = "amd64" ] ; then echo "64bit" ; else echo "arm64" ; fi)/session-manager-plugin.deb && dpkg -i session-manager-plugin.deb && rm session-manager-plugin.deb
# CDK Install
RUN npm i -g aws-cdk
COPY requirements.txt ./requirements.txt
RUN pip3 install -v -r requirements.txt
RUN git clone https://github.com/theserverlessway/awsinfo.git /awsinfo
RUN ln -s /awsinfo/scripts/awsinfo.bash /usr/local/bin/awsinfo
RUN awsinfo complete > /root/.awsinfo_completion
RUN git clone https://github.com/toniblyx/prowler.git /prowler
ENV PATH="/prowler:${PATH}"
RUN git clone https://github.com/OpenVPN/easy-rsa.git /easy-rsa
ENV PATH="/easy-rsa/easyrsa3:${PATH}"
COPY bashrc /root/bashrc
RUN tr -d '\r' < /root/bashrc > /root/.bashrc && rm /root/bashrc
COPY gitconfig /root/.gitconfig
RUN git config --global credential.helper '!aws codecommit credential-helper $@'
RUN git config --global credential.UseHttpPath true
RUN git clone https://github.com/magicmonty/bash-git-prompt.git /bash-git-prompt --depth=1
COPY ./scripts ./toolbox-scripts
CMD ["/bin/bash"]