No description
Find a file
2025-12-03 23:04:01 +00:00
.woodpecker fix: update package manager from apk to dnf in CI pipeline 2025-11-18 08:02:16 +01:00
.hadolint.yaml feat: Add kubectl build environment with CI/CD pipeline 2025-11-12 09:04:50 +01:00
cog.toml feat: Add kubectl build environment with CI/CD pipeline 2025-11-12 09:04:50 +01:00
Dockerfile chore(deps): update alpine docker digest to a107a3c 2025-12-03 22:03:13 +00:00
Justfile feat: migrate CI pipeline from buildah to podman and add Justfile 2025-11-18 07:54:58 +01:00
LICENSE.md feat: Add kubectl build environment with CI/CD pipeline 2025-11-12 09:04:50 +01:00
README.md feat: Add kubectl build environment with CI/CD pipeline 2025-11-12 09:04:50 +01:00
renovate.json chore(deps): add renovate.json 2025-11-12 17:41:42 +00:00

kubectl Docker Image

A minimal Alpine-based Docker image containing kubectl, kustomize, and helm for Kubernetes operations.

What's included

  • kubectl - Kubernetes command-line tool
  • kustomize - Kubernetes native configuration management
  • helm - Kubernetes package manager
  • Alpine Linux - Small and secure base image

Usage

Basic usage

docker run --rm -it \
  -v "$HOME/.kube:/root/.kube:ro" \
  kubectl get pods

Using with kustomize

docker run --rm -it \
  -v "$PWD:/work" \
  -w /work \
  kubectl kustomize build .

Using with helm

docker run --rm -it \
  -v "$PWD:/work" \
  -w /work \
  kubectl helm template my-release ./chart

Interactive shell

docker run --rm -it \
  -v "$HOME/.kube:/root/.kube:ro" \
  -v "$PWD:/work" \
  -w /work \
  kubectl sh

Kubernetes configuration

Mount your kubeconfig to access your clusters:

docker run --rm -it \
  -v "$HOME/.kube:/root/.kube:ro" \
  kubectl cluster-info

For production use, consider using Kubernetes secrets or service accounts instead of mounting kubeconfig files.

Image tags

  • latest - Latest version
  • main - Latest build from main branch
  • vX.Y.Z - Versioned releases

Pull the image:

docker pull codeberg.org/purplebooth/kubectl:main

Building locally

docker build -t kubectl .

License

This project is released under The Unlicense. See LICENSE.