initial commit
This commit is contained in:
parent
7b8e069bec
commit
393320003e
5 changed files with 164 additions and 0 deletions
45
Dockerfile
Normal file
45
Dockerfile
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# Debian Bookworm image with basic tools, kubectl and k3d
|
||||
FROM debian:bookworm-slim
|
||||
|
||||
LABEL maintainer="you <you@example.com>"
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV PATH="/usr/local/bin:${PATH}"
|
||||
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
RUN set -eux; \
|
||||
apt-get update; \
|
||||
apt-get upgrade -y; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl gnupg lsb-release wget git vim less procps iproute2 bash; \
|
||||
apt-get clean; \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*;
|
||||
|
||||
# Install modern Docker CLI (docker-ce-cli) from Docker's official APT repository
|
||||
RUN set -eux; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends gnupg2; \
|
||||
mkdir -p /etc/apt/keyrings; \
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg; \
|
||||
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends docker-ce-cli; \
|
||||
apt-get purge -y --auto-remove gnupg2; \
|
||||
rm -rf /etc/apt/keyrings/docker.gpg /etc/apt/sources.list.d/docker.list /var/lib/apt/lists/* /tmp/* /var/tmp/*;
|
||||
|
||||
# Install kubectl (stable)
|
||||
RUN set -eux; \
|
||||
KUBECTL_VERSION="$(curl -L -s https://dl.k8s.io/release/stable.txt)"; \
|
||||
curl -fsSLO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl"; \
|
||||
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl; \
|
||||
rm -f kubectl; \
|
||||
kubectl version --client --kubeconfig=/dev/null || true
|
||||
|
||||
# Install k3d via official install script (use --no-sudo; -b is not supported)
|
||||
RUN set -eux; \
|
||||
curl -fsSL https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash -s -- --no-sudo; \
|
||||
command -v k3d >/dev/null && k3d --version || true
|
||||
|
||||
# Default to an interactive shell
|
||||
CMD ["/bin/bash"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue