Lightweight, Versioned Kubernetes Kubectl CLI Containers for Seamless Cluster Management
The source code for this image can be found in the kubernetes repository.
The Dockerfile is located in the dockerfiles/k8s-tools/kubectl directory.
The image is built using a multi-stage build process, ensuring a minimal footprint and secure.
This repository provides Docker images under the anvesh35/k8s-tools namespace that package Kubernetes CLI tools—including kubectl, helm, velero, and flux—into lightweight, self-contained containers so users can manage clusters without installing binaries locally. Each image employs a multi-stage build on Alpine Linux, runs as a non-root user, and includes only the necessary binaries to keep the footprint minimal (~9 MB) and secure.
Users often need different versions of Kubernetes tools across projects, leading to local dependency conflicts and manual installations.
This repository solves that by offering pre-built Docker images for each CLI, letting you simply docker run to enter a shell with your tool of choice ready to use.
All images live in the anvesh35/k8s-tools Docker Hub repository .
Tags follow the pattern <toolname>-<version>, for example kubectl-1.29.3, using lowercase letters and hyphens to comply with Docker naming rules.
An optional allinone-latest tag bundles multiple CLIs into a single image for quick setups.
git clone https://github.com/anveshmuppeda/kubernetes.git
cd dockerfiles/k8s-tools/<toolname>
docker build \
--build-arg KUBECTL_VERSION=v1.29.3 \
-t anvesh35/k8s-tools:kubectl-1.29.3 .
docker run --rm -it \
--network host \
-v $HOME/.kube/config:/home/kube/.kube/config:ro \
anvesh35/kubectl-cli:v1.29.3 bash
This opens a Bash shell in /home/kube with the specified CLI in your PATH
docker run --rm \
--network host \
-v $HOME/.kube/config:/home/kube/.kube/config:ro \
anvesh35/kubectl-cli:v1.29.3 \
kubectl get pods
Mounting your kubeconfig read-only ensures safe cluster access without local installations .
kube user to adhere to container security best practices.kubectl-1.29.3) and an allinone-latest aggregate image.Contributions are welcome via GitHub pull requests. Please follow multi-stage build patterns, use semantic versioning for new tool images, and adhere to lowercase, hyphenated naming conventions.
Content type
Image
Digest
sha256:8361be2c6…
Size
34.6 MB
Last updated
over 1 year ago
docker pull anvesh35/kubectl-cli