-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
134 lines (124 loc) · 3.82 KB
/
Dockerfile
File metadata and controls
134 lines (124 loc) · 3.82 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
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
# Debugcontainer - custom image
#
# Thanks to
# - https://github.com/dbamaster/mssql-tools-alpine
# - https://github.com/ssro/dnsperf
FROM alpine:3.23.3
# Resolve DL4006 https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
# Labels
LABEL org.opencontainers.image.authors="Thomas Deutsch <thomas@tuxpeople.org>" \
org.opencontainers.image.description="Debug container with networking and troubleshooting tools"
# Tool versions (managed by Renovate)
ARG FLUX_VERSION=2.8.1
ARG CARVEL_YTT_VERSION=0.53.2
ARG CARVEL_IMGPKG_VERSION=0.47.2
ARG ORAS_VERSION=1.3.0
COPY scripts/* /scripts/
COPY requirements.txt /requirements.txt
# hadolint ignore=DL3017,DL3018,DL3013
RUN chmod +x /scripts/* \
&& apk --update upgrade \
&& apk add --no-cache --update \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/main \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/community \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing \
arping \
bash \
bash-completion \
bind-libs \
bind-tools \
ca-certificates \
coreutils \
curl \
crane \
dnsperf \
ethtool \
fio \
git \
hdparm \
htop \
ioping \
iozone \
iperf \
iperf3 \
iproute2 \
ipset \
iptables \
jq \
kmod \
kubectl \
less \
lsof \
mariadb-client \
mariadb-connector-c \
mc \
minio-client \
mtr \
multitail \
net-tools \
netcat-openbsd \
nfs-utils \
ngrep \
nmap \
openssh \
openssh-client \
openssl \
p7zip \
parallel \
perl-utils \
psmisc \
py3-pip \
rsync \
screen \
socat \
speedtest-cli \
sslscan \
tcpdump \
tcptraceroute \
inetutils-telnet \
tmux \
tree \
vim \
wget \
which \
yq \
&& OS="$(uname -s | tr A-Z a-z)" \
&& ARCH="$(uname -m | sed -e 's/x86_64/amd64/g' -e 's/aarch64/arm64/g')" \
&& curl -sL "https://github.com/fluxcd/flux2/releases/download/v${FLUX_VERSION}/flux_${FLUX_VERSION}_${OS}_${ARCH}.tar.gz" | tar xz -C /usr/local/bin \
&& curl -sL "https://github.com/carvel-dev/ytt/releases/download/v${CARVEL_YTT_VERSION}/ytt-${OS}-${ARCH}" -o /usr/local/bin/ytt \
&& curl -sL "https://github.com/carvel-dev/imgpkg/releases/download/v${CARVEL_IMGPKG_VERSION}/imgpkg-${OS}-${ARCH}" -o /usr/local/bin/imgpkg \
&& chmod +x /usr/local/bin/ytt /usr/local/bin/imgpkg \
&& curl -LO "https://github.com/oras-project/oras/releases/download/v${ORAS_VERSION}/oras_${ORAS_VERSION}_${OS}_${ARCH}.tar.gz" \
&& mkdir -p oras-install/ \
&& tar -zxf "oras_${ORAS_VERSION#v}_${OS}_${ARCH}.tar.gz" -C oras-install/ \
&& mv oras-install/oras /usr/local/bin/ \
&& rm -rf "oras_${ORAS_VERSION}_${OS}_${ARCH}.tar.gz" oras-install/ \
&& oras completion bash > /etc/bash_completion.d/oras \
&& echo "v${ORAS_VERSION}" > /etc/oras-version \
&& echo "v${FLUX_VERSION}" > /etc/flux-version \
&& echo "v${CARVEL_YTT_VERSION}" > /etc/ytt-version \
&& echo "v${CARVEL_IMGPKG_VERSION}" > /etc/imgpkg-version \
&& apk add --no-cache --virtual .build-deps musl-dev python3-dev libffi-dev openssl-dev cargo make \
&& pip install --break-system-packages --no-cache-dir --upgrade pip \
&& pip install --break-system-packages --no-cache-dir --requirement /requirements.txt \
&& apk del .build-deps \
&& rm -f /requirements.txt \
&& crane completion bash > /etc/bash_completion.d/crane \
&& mkdir /workdir \
&& chmod 755 /workdir \
&& addgroup -g 1000 abc \
&& adduser -G abc -u 1000 abc -D \
&& rm -rf /var/cache/apk/*
WORKDIR /workdir
# Pinned tool versions are stored in /etc/ for runtime inspection
# - /etc/oras-version: ORAS CLI version
# - /etc/flux-version: Flux CLI version
# - /etc/ytt-version: Carvel ytt version
# - /etc/imgpkg-version: Carvel imgpkg version
# environment settings
ENV PS1="\u@debugcontainer($(hostname)):\w\\$ " \
HOME="/workdir" \
TERM="xterm" \
TZ="Europe/Zurich"
CMD ["/bin/sleep","inf"]