Lightweight, Versioned FluxCD CLI Container for Seamless Kubernetes GitOps Management
393
Lightweight, Versioned FluxCD CLI Container for Seamless Kubernetes GitOps Management
This repository provides a Docker image under the anvesh35/fluxcd-cli namespace that packages the FluxCD CLI into a lightweight, self-contained container. This allows users to manage FluxCD GitOps workflows without installing the Flux CLI locally. The image is built using a multi-stage build process on Alpine Linux, ensuring a minimal footprint and secure execution.
All images are hosted on Docker Hub under the anvesh35/fluxcd-cli repository.
Tags follow the pattern <version>, for example v2.1.0, to indicate the FluxCD CLI version included in the image.
git clone https://github.com/anveshmuppeda/kubernetes.git
cd dockerfiles/k8s-tools/fluxcd
Replace <version> with the desired FluxCD CLI version (e.g., 2.1.0):
docker build \
--build-arg FLUX_VERSION=<version> \
-t anvesh35/fluxcd-cli:<version> .
Example:
docker build \
--build-arg FLUX_VERSION=2.1.0 \
-t anvesh35/fluxcd-cli:v2.1.0 .
To use the pre-built image from Docker Hub, pull it using:
docker pull anvesh35/fluxcd-cli:<version>
Example:
docker pull anvesh35/fluxcd-cli:v2.1.0
Run the container interactively with your kubeconfig mounted for cluster access:
docker run --rm -it \
--network host \
-v $HOME/.kube/config:/home/flux/.kube/config:ro \
anvesh35/fluxcd-cli:<version> bash
This opens a Bash shell with the FluxCD CLI installed and ready to use.
Run FluxCD commands directly without entering the container:
docker run --rm \
--network host \
-v $HOME/.kube/config:/home/flux/.kube/config:ro \
anvesh35/fluxcd-cli:<version> \
flux check --pre
flux user to adhere to container security best practices.v2.1.0).docker run --rm \
anvesh35/fluxcd-cli:v2.1.0 \
flux version
docker run --rm \
--network host \
-v $HOME/.kube/config:/home/flux/.kube/config:ro \
anvesh35/fluxcd-cli:v2.1.0 \
flux check --pre
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.
This project is licensed under the MIT License. See the LICENSE file for details.
Content type
Image
Digest
sha256:f7217c305…
Size
40.5 MB
Last updated
over 1 year ago
docker pull anvesh35/fluxcd-cli