d3fk/helm
Helm 3(official binary) minimal image from Scratch updated monthly, usable in any docker or k8s env
291
A super lightweight container built from scratch with Helm official binary, a default non-root user and ssl/tls validation capabilities (~52MB -> ). This container uses the latest Helm binary, fetched from the official Helm releases and built into a scratch image. It supports multiple architectures and is updated monthly to ensure you're using the latest stable version of Helm. The
d3fk/helm
container is ideal for managing and deploying Helm charts in your kubernetes clusters, and running Helm commands within CI/CD pipelines or other minimal environments.
This container is also especially convenient with tiny/immutable linux distro such as Flatcar Container Linux, taking advantage of the immutability of Docker images without requiring the use of a package manager... see-> Tips: Super fast setup
The best way to get the d3fk/helm
image is to pull the prebuilt image from the Docker Hub Registry.
The image is prebuilt as a multi-arch image with "automated build" enabled on its code repository.
Image name: d3fk/helm
$ docker pull d3fk/helm:latest
Docker Hub repository: https://hub.docker.com/r/d3fk/helm/
The d3fk/helm images are multi-arch images that exist with the latest tag and versionned tags
Supported architectures:
You can use the d3fk/helm container images to manage Helm charts and deploy them on your Kubernetes clusters from different platforms.
The d3fk/helm:latest multi-arch image is updated monthly to ensure you have the latest stable version of Helm.This last stable version of Helm is currently related to the last release of Helm on its github repository which is reported Here.
In case you require a fixed version of Helm to avoid any possible alteration of its behavior in the future, the following tagged images are also made available from the Docker hub (as multi-arch images). In each of these images the version was freezed in a release of the main code repo and built from the Docker hub by automated build. These images are stable and won't be rebuilt in the future:
$ docker run --rm d3fk/helm
This command will display the Helm help menu, listing available commands and main configuration paths.
The container follows best practices by running with a non-root user named helm
with a UID of 6009
. This UID should avoid interference with existing users by default when working with your local filesystem (e.g, access to config files, mounted volumes...). However , to replicate the same behavior as if you were using Helm locally, it is advised to set the container user with your UID when running by using the --user
option
As we'll make use of files with Helm (e.g., access your config files, package your charts), it is important to know that the container's working directory is set to /files
(e.g. for your YAML charts), the user home is set to /
(e.g. used for confing files) and that 3 environment variables have been set respectively for cache, configuration and data:
HELM_CACHE_HOME="/.helm/.cache/helm"
HELM_CONFIG_HOME="/.helm/.config/helm"
HELM_DATA_HOME="/.helm/.local/share/helm"
You can mount your local files into those locations and reference them in your Helm commands.
The environment variables in the container can be overwritten in the docker run command with --env
to addapt the helm cache (HELM_CACHE_HOME
), configuration(HELM_CONFIG_HOME
) and data (HELM_DATA_HOME
) paths to your needs.
When working with files, you should either:
--user
option when running the Docker container, setting it to a user with appropriate access rights to the files or directories Helm needs to use, or/
or /files
has appropriate access rights for manipulation by a different user, specifically the container default user helm
(6009) if no --user
option set.To use your Helm configuration and connect to a Kubernetes cluster, mount your local Helm configuration and Kubernetes credentials into the container.
$ docker run --rm --user $(id -u):$(id -g) -v $HOME/.kube:/.kube -v $HOME/.helm:/.helm d3fk/helm
In this example, we assume that the user running the container has appropriate access rights to the configuration files and that Helm cache ,config and data folders are all in $HOME/.helm
In case you already were using a local Helm, you can reuse your configuration by either
.cache/helm .config/helm .local/share/helm
into a directory that you'll be able to mount on the /.helm/ path location of the containerIn order to provide an existing path to mount Helm cache, configuration, and data and avoid that the docker mount action creates the path with unappropriate right it is preferable to make the user create the empty directories ahead of running helm:
$ mkdir -p $HOME/.helm/.cache/helm $HOME/.helm/.config/helm $HOME/.helm/.local/share/helm
Assuming here that Helm will be used from the current user account so the helm directories .cache/helm
, .config/helm
and .local/share/helm
will all be located into your local $HOME/.helm/
directory.
You can then start configuring Helm by using the Helm command lines e.g:
$ docker run --rm --user $(id -u):$(id -g) -v $HOME/.kube:/.kube -v $HOME/.helm:/.helm d3fk/helm repo add bitnami https://charts.bitnami.com/bitnami
$ docker run --rm --user $(id -u):$(id -g) -v $HOME/.kube:/.kube -v $HOME/.helm:/.helm d3fk/helm repo update
To install a Helm chart, you can use the following command:
$ docker run --rm --user $(id -u):$(id -g) -v $HOME/.kube:/.kube -v $HOME/.helm:/.helm d3fk/helm install my-release stable/my-chart
To list all Helm releases of charts in your cluster:
$ docker run --rm --user $(id -u):$(id -g) -v $HOME/.kube:/.kube -v $HOME/.helm:/.helm d3fk/helm list
$ docker run --rm --user $(id -u):$(id -g) -v $(pwd):/files -v $HOME/.kube:/.kube -v $HOME/.helm:/.helm d3fk/helm package my-local-chart-directory
In this example, my-local-chart-directory
refers to the directory of the chart you need to package from your local folder.
In case you need to use Helm interactively (no use case in mind but might exist), remember to run the container with the -ti
options.
To simplify the usage of Helm via Docker, you can simply create an alias in your shell or `.bashrc`, `.shrc`, `.rc`...
In case you only need a rapid access to Helm, assuming your kubernetes config is present in $HOME/.kube and accessible to the current user you can simply copy paste the following lines in your prompt
mkdir -p $HOME/.helm/.cache/helm $HOME/.helm/.config/helm $HOME/.helm/.local/share/helm
alias helm='docker run --rm --user $(id -u):$(id -g) -ti -v $(pwd):/files -v $HOME/.kube:/.kube -v $HOME/.helm:/.helm d3fk/helm'
You can then run d3fk/helm container commands as if they were standard Helm commands, e.g:
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo update
helm search repo mariadb
helm install mariadb bitnami/mariadb
The Helm configuration, cache and data will be held in your $HOME/.helm/
for any future access.
As the alias was only added in your prompt it is only available for your current session, to make Helm available from any future session simply add the alias in your launch shell script e.g .bashrc
The content of this GitHub code repository is provided under MIT licence
.
For helm license information, please see https://github.com/helm/helm .
If you're using Helm, you might also be interested in the d3fk/kubectl container. It offers a similar lightweight and minimalistic approach for managing your Kubernetes clusters using the kubectl command-line tool.
You can find more details and usage instructions for the d3fk/kubectl container on Docker Hub or its GitHub repository.
docker pull d3fk/helm