-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
78 lines (66 loc) · 2.18 KB
/
Copy pathDockerfile
File metadata and controls
78 lines (66 loc) · 2.18 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
# fetch containerd cli & kubectl tools
FROM curlimages/curl:8.18.0 AS downloader
ARG TARGETARCH
ENV CRICTL_VERSION="v1.35.0"
ENV WITR_VERSION="0.3.0"
WORKDIR /tmp
# Download and extract crictl
RUN curl -LO https://github.com/kubernetes-sigs/cri-tools/releases/download/${CRICTL_VERSION}/crictl-${CRICTL_VERSION}-linux-${TARGETARCH}.tar.gz && \
tar zxf crictl-${CRICTL_VERSION}-linux-${TARGETARCH}.tar.gz && \
rm crictl-${CRICTL_VERSION}-linux-${TARGETARCH}.tar.gz && \
chmod +x crictl
# Download kubectl
RUN curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${TARGETARCH}/kubectl" && \
chmod +x kubectl
# Download witr package for later installation in main image
RUN curl -Lo witr.deb https://github.com/pranshuparmar/witr/releases/download/v${WITR_VERSION}/witr-${WITR_VERSION}-linux-${TARGETARCH}.deb
# Main image build
FROM debian:bookworm-slim
# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive
# Copy binaries from downloader stage
COPY --from=downloader /tmp/crictl /usr/local/bin/crictl
COPY --from=downloader /tmp/kubectl /usr/local/bin/kubectl
COPY --from=downloader /tmp/witr.deb /witr.deb
# Copy configuration files in single layer
COPY ./.tmux.conf /root/.tmux.conf
COPY ./.bash_aliases /root/.bash_aliases
# Install essential packages only, grouped by purpose
RUN apt-get update && \
apt-get install --no-install-recommends -y \
# Core utilities
bash \
curl \
ca-certificates \
# Network debugging (core set)
dnsutils \
iptables \
iputils-ping \
iproute2 \
netcat-openbsd \
socat \
tcpdump \
# System monitoring (essential)
lsof \
procps \
systemd \
# File/text processing
jq \
yq \
# Terminal/editor
tmux \
nvi \
&& \
# Thorough cleanup
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
# Create necessary directories
mkdir -p /root/.config
# Install witr
RUN dpkg -i /witr.deb
RUN rm -f /witr.deb
# Set working directory
WORKDIR /root
# Default command
CMD ["tmux"]