From cea818847a9c08e34b241b38efbe9aa4b48cf05c Mon Sep 17 00:00:00 2001 From: Garrett Mills Date: Tue, 6 Oct 2026 20:14:44 +0000 Subject: [PATCH] Add Docker CLI tools to jump box --- jump-box/Dockerfile | 4 +++- jump-box/startup.bash | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/jump-box/Dockerfile b/jump-box/Dockerfile index a8f3397..cb8ee2f 100644 --- a/jump-box/Dockerfile +++ b/jump-box/Dockerfile @@ -3,6 +3,7 @@ FROM fedora:44 ENV TARGET_USER=garrettmills ENV TARGET_UID=1000 ENV TARGET_GID=1000 +ENV DOCKER_RUN_DIR=/run/dind COPY k8s.repo /etc/yum.repos.d/k8s.repo COPY startup.bash /usr/sbin/startup.bash @@ -15,7 +16,8 @@ RUN dnf install -y \ procps-ng rsync screen sudo which autojump hostname jq the_silver_searcher wget \ coreutils util-linux openssh-server bind-utils kubectl iproute iputils ffmpeg \ && wget -O /etc/yum.repos.d/kanidm.repo https://download.opensuse.org/repositories/network:/idm/Fedora_44/network:idm.repo \ - && dnf install -y kanidm-clients \ + && wget -O /etc/yum.repos.d/docker-ce.repo https://download.docker.com/linux/fedora/docker-ce.repo \ + && dnf install -y kanidm-clients docker-ce-cli docker-buildx-plugin docker-compose-plugin \ && dnf clean all -y \ && chmod +x /usr/sbin/startup.bash diff --git a/jump-box/startup.bash b/jump-box/startup.bash index 19b3c8a..f354cb9 100644 --- a/jump-box/startup.bash +++ b/jump-box/startup.bash @@ -9,6 +9,11 @@ keys=( /etc/ssh/keys/ssh_host_*_key ) mkdir -p "$(dirname "/etc/ssh/sshd_config.d/10-hostkeys.conf")" printf 'HostKey %s\n' "${keys[@]}" > "/etc/ssh/sshd_config.d/10-hostkeys.conf" +# Setup the DinD socket: +if [ -z DOCKER_RUN_DIR ]; then + ln -s /run/dind/docker.sock /var/run/docker.sock || echo "Failed to symlink Docker socket!" +fi + # Setup the target user and their group echo "Setting up target user ${TARGET_USER} (uid=${TARGET_UID}, gid=${TARGET_GID})..." groupadd --gid "$TARGET_GID" "$TARGET_USER"