forked from nicolaka/netshoot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·240 lines (220 loc) · 6.58 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
ARG ALPINE_VERSION=3.19
# build the final image
FROM alpine:${ALPINE_VERSION}
RUN set -ex; \
echo "https://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories; \
echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories; \
echo "https://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories; \
apk -U upgrade; \
apk add -u --no-cache !pyc\
btrfs-progs \
e2fsprogs \
e2fsprogs-extra \
shadow-uidmap \
xfsprogs \
xz \
pigz; \
apk add -u --no-cache !pyc\
7zip \
apache2-utils \
atop \
aws-cli \
aws-cli-bash-completion \
aws-cli-doc \
btop \
bash \
bash-completion \
bpftool \
bcc-tools \
bind-tools \
bird \
bpftrace \
bpftrace-tools \
bridge-utils \
buildah \
busybox-extras \
ca-certificates \
cgroup-tools \
conntrack-tools \
coreutils \
curl \
ctop \
dhcping \
diffutils \
drill \
ethtool \
ethtool-bash-completion \
fatrace \
file \
findutils \
fio \
fping \
fuse-overlayfs \
git \
git-bash-completion \
grep \
helm \
helm-bash-completion \
hping3 \
htop \
httpie \
iftop \
inotify-tools \
ioping \
iperf \
iperf3 \
iproute2 \
iproute2-bash-completion \
ipset \
iptables \
ip6tables \
iptraf-ng \
iputils \
ipvsadm \
ipython \
jo \
jo-bash-completion \
jq \
k9s \
k9s-bash-completion \
kubectl \
kubectl-bash-completion \
kubectl-krew \
less \
liboping \
ltrace \
lttng-tools \
moreutils \
mtr \
neofetch \
net-snmp-tools \
netcat-openbsd \
nftables \
ngrep \
nmap \
nmap-nping \
open-lldp \
openssh \
openssl \
perf \
perf-bash-completion \
podman \
podman-bash-completion \
podman-docker \
podman-tui \
procps \
procs \
procs-bash-completion \
pstree \
py3-pip \
py3-pip-bash-completion \
py3-cryptography \
py3-yaml \
py3-ruamel.yaml \
py3-virtualenv \
python3 \
ripgrep \
ripgrep-bash-completion \
scapy \
shadow \
skopeo \
skopeo-bash-completion \
socat \
stern \
stern-bash-completion \
strace \
stress-ng \
stress-ng-bash-completion \
su-exec \
sudo \
swaks \
sysstat \
tar \
tcpdump \
tcptraceroute \
tini \
tiptop \
termshark \
tshark \
tree \
unzip \
util-linux \
vim \
websocat \
wget \
wireguard-tools \
wireguard-tools-bash-completion \
yq \
yq-bash-completion; \
rm -f /var/cache/apk/*
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
# as of Alpine 3.19 root
RUN python3 -m virtualenv --system-site-packages /root/venv
# let's install httpx, ipython and jc
RUN \
PATH="/root/venv/bin:$PATH"; \
python -m pip install --upgrade --no-cache-dir httpx[cli,brotli,http2,socks] jc
# Installing calicoctl
ARG CALICOCTL_VERSION=v3.27.0
RUN \
wget -q https://github.com/projectcalico/calico/releases/download/${CALICOCTL_VERSION}/calicoctl-linux-amd64 -O /usr/local/bin/calicoctl; \
chmod +x /usr/local/bin/calicoctl
# krew plugins
RUN \
PATH="$HOME/.krew/bin:$PATH"; \
kubectl krew install cert-manager ctx explore get-all oidc-login node-shell ns relay resource-capacity sniff topology
# Installing grpcurl
ARG GRPCURL_VERSION=1.8.9
RUN \
curl --fail --silent -L https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_linux_x86_64.tar.gz | \
tar zx --no-same-owner grpcurl; \
chmod +x grpcurl; \
mv grpcurl /usr/local/bin
# Installing Fortio
ARG FORTIO_VERSION=1.63.2
RUN \
curl --fail --silent -L "https://github.com/fortio/fortio/releases/download/v${FORTIO_VERSION}/fortio-linux_amd64-${FORTIO_VERSION}.tgz" | \
tar zx --no-same-owner --strip-components=2 usr/bin/fortio; \
chmod +x fortio; \
mv fortio /usr/local/bin
# kubectl aliases
RUN \
curl --fail --silent --location https://rawgit.com/ahmetb/kubectl-alias/master/.kubectl_aliases -o "$HOME/.kubectl_aliases"
# FIXME: figure out how to run podman in alpine container.
#RUN modprobe tun; \
# echo tun >>/etc/modules;
# setting up podman - https://github.com/containers/podman/blob/main/contrib/podmanimage/stable/Containerfile
#RUN useradd podman; \
#echo -e "podman:1:999\npodman:1001:64535" > /etc/subuid; \
#echo -e "podman:1:999\npodman:1001:64535" > /etc/subgid;
#ARG _REPO_URL="https://raw.githubusercontent.com/containers/podman/main/contrib/podmanimage/stable"
#ADD $_REPO_URL/containers.conf /etc/containers/containers.conf
#ADD $_REPO_URL/podman-containers.conf /home/podman/.config/containers/containers.conf
#RUN mkdir -p /home/podman/.local/share/containers && \
# chown podman:podman -R /home/podman && \
# chmod 644 /etc/containers/containers.conf
# Copy & modify the defaults to provide reference if runtime changes needed.
# Changes here are required for running with fuse-overlay storage inside container.
#RUN sed -e 's|^#mount_program|mount_program|g' \
# -e '/additionalimage.*/a "/var/lib/shared",' \
# -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \
# /usr/share/containers/storage.conf \
# > /etc/containers/storage.conf
# Note VOLUME options must always happen after the chown call above
# RUN commands can not modify existing volumes
#VOLUME /var/lib/containers
#VOLUME /home/podman/.local/share/containers
#RUN mkdir -p /var/lib/shared/overlay-images \
# /var/lib/shared/overlay-layers \
# /var/lib/shared/vfs-images \
# /var/lib/shared/vfs-layers && \
# touch /var/lib/shared/overlay-images/images.lock && \
# touch /var/lib/shared/overlay-layers/layers.lock && \
# touch /var/lib/shared/vfs-images/images.lock && \
# touch /var/lib/shared/vfs-layers/layers.lock
#ENV _CONTAINERS_USERNS_CONFIGURED=""
# Settings
ADD motd /etc/motd
ADD .bashrc /root/.bashrc
ADD profile /root/.profile
CMD ["/bin/bash","-l"]