Block a user
sandbox-lab/sandbox-kubesolo (latest)
Published 2026-04-07 00:16:43 +02:00 by adelorenzo
Installation
docker pull git.oe74.net/adelorenzo/sandbox-lab/sandbox-kubesolo:latestsha256:a426a9f4f1e57256ab937a9334553c69af077c990da64d25178460a02d82ccb1
Images
| Digest | OS / Arch | Size |
|---|---|---|
| f7fdfe4b3e | linux/amd64 | 206 MiB |
Image Layers ( linux/amd64)
| ARG RELEASE |
| ARG LAUNCHPAD_BUILD_ARCH |
| LABEL org.opencontainers.image.ref.name=ubuntu |
| LABEL org.opencontainers.image.version=24.04 |
| ADD file:3f78aa860931e0853077f09eb31eddbeeef8a9dd70977305b4876aa176770721 in / |
| CMD ["/bin/bash"] |
| ENV DEBIAN_FRONTEND=noninteractive |
| RUN /bin/sh -c apt-get update && apt-get install -y sudo curl wget git vim nano net-tools iputils-ping dnsutils jq htop ca-certificates gnupg lsb-release bash-completion systemd systemd-sysv iptables && rm -rf /var/lib/apt/lists/* # buildkit |
| RUN /bin/sh -c TTYD_VERSION=$(curl -s https://api.github.com/repos/tsl0922/ttyd/releases/latest | jq -r .tag_name) && wget -O /usr/local/bin/ttyd "https://github.com/tsl0922/ttyd/releases/download/${TTYD_VERSION}/ttyd.$(uname -m)" && chmod +x /usr/local/bin/ttyd # buildkit |
| RUN /bin/sh -c KUBECTL_VERSION=$(curl -sfL https://dl.k8s.io/release/stable.txt) && curl -sfL -o /usr/local/bin/kubectl "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/amd64/kubectl" && chmod +x /usr/local/bin/kubectl # buildkit |
| RUN /bin/sh -c curl -sfL https://get.k3s.io -o /usr/local/bin/install-k3s.sh && chmod +x /usr/local/bin/install-k3s.sh # buildkit |
| RUN /bin/sh -c curl -sfL https://downloads.portainer.io/ce2-21/portainer-agent-k8s-nodeport.yaml -o /opt/portainer-agent-k8s.yaml # buildkit |
| RUN /bin/sh -c mkdir -p /var/lib/rancher/k3s/agent/images && AGENT_TAG=$(grep -oP 'image:\s*portainer/agent:\K[^\s]+' /opt/portainer-agent-k8s.yaml || echo "2.21.5") && apt-get update && apt-get install -y skopeo && skopeo copy docker://portainer/agent:${AGENT_TAG} docker-archive:/var/lib/rancher/k3s/agent/images/portainer-agent.tar:portainer/agent:${AGENT_TAG} && apt-get remove -y skopeo && apt-get autoremove -y && rm -rf /var/lib/apt/lists/* # buildkit |
| RUN /bin/sh -c cat > /etc/systemd/system/k3s-setup.service << 'SVC' [Unit] Description=Install K3s on first boot After=network.target ConditionPathExists=!/usr/local/bin/k3s [Service] Type=oneshot Environment=HOME=/root INSTALL_K3S_SKIP_START=false ExecStart=/usr/local/bin/install-k3s.sh --write-kubeconfig-mode 644 RemainAfterExit=yes TimeoutStartSec=300 [Install] WantedBy=multi-user.target SVC # buildkit |
| RUN /bin/sh -c systemctl enable k3s-setup.service # buildkit |
| RUN /bin/sh -c cat > /etc/systemd/system/k3s-post-setup.service << 'SVC' [Unit] Description=Configure kubeconfig and deploy Portainer Agent After=network.target [Service] Type=oneshot Environment=HOME=/root ExecStart=/bin/bash -c '\ echo "Waiting for K3s kubeconfig..."; \ until [ -f /etc/rancher/k3s/k3s.yaml ]; do sleep 2; done; \ echo "Kubeconfig found, copying to labuser..."; \ mkdir -p /home/labuser/.kube && \ cp /etc/rancher/k3s/k3s.yaml /home/labuser/.kube/config && \ chown -R labuser:labuser /home/labuser/.kube; \ export KUBECONFIG=/etc/rancher/k3s/k3s.yaml; \ echo "Waiting for node Ready..."; \ until kubectl get nodes 2>/dev/null | grep -q " Ready"; do sleep 3; done; \ echo "Importing Portainer Agent image..."; \ k3s ctr images import /var/lib/rancher/k3s/agent/images/portainer-agent.tar 2>/dev/null || true; \ echo "Deploying Portainer Agent..."; \ kubectl apply -f /opt/portainer-agent-k8s.yaml; \ echo "Waiting for Agent pod Running..."; \ until kubectl -n portainer get pods -l app=portainer-agent -o jsonpath="{.items[0].status.phase}" 2>/dev/null | grep -q Running; do sleep 3; done; \ echo "Portainer Agent deployed successfully"' RemainAfterExit=yes TimeoutStartSec=600 [Install] WantedBy=multi-user.target SVC # buildkit |
| RUN /bin/sh -c systemctl enable k3s-post-setup.service # buildkit |
| RUN /bin/sh -c echo 'export KUBECONFIG=/home/labuser/.kube/config' >> /etc/profile.d/k3s.sh && chmod +x /etc/profile.d/k3s.sh # buildkit |
| ENV USER=labuser |
| RUN /bin/sh -c useradd -m -s /bin/bash ${USER} && echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers # buildkit |
| RUN /bin/sh -c printf '#!/bin/bash\necho ""\necho " ╔══════════════════════════════════════════╗"\necho " ║ Welcome to Your Kubernetes Sandbox! ║"\necho " ║ ║"\necho " ║ K3s is starting up... ║"\necho " ║ kubectl get nodes ║"\necho " ║ kubectl get pods -A ║"\necho " ║ ║"\necho " ║ Your files persist between sessions. ║"\necho " ╚══════════════════════════════════════════╝"\necho ""\n' > /etc/profile.d/welcome.sh && chmod +x /etc/profile.d/welcome.sh # buildkit |
| ENTRYPOINT ["/sbin/init" "--log-level=err"] |
Labels
| Key | Value |
|---|---|
| org.opencontainers.image.ref.name | ubuntu |
| org.opencontainers.image.version | 24.04 |