Kaniko Image Builder
Building container images with Kaniko.
When to use it
You should use the Kaniko image builder if:
you're familiar with/already using Kubernetes.
How to deploy it
In order to use the Kaniko image builder, you need a deployed Kubernetes cluster.
How to use it
To use the Kaniko image builder, we need:
The ZenML
kaniko
integration installed. If you haven't done so, runOptionally, you can change the timeout (in seconds) until the Kaniko pod is running in the orchestrator using the
pod_running_timeout
attribute.
We can then register the image builder and use it in our active stack:
Authentication for the container registry and artifact store
The Kaniko image builder will create a Kubernetes pod that is running the build. This build pod needs to be able to pull from/push to certain container registries, and depending on the stack component configuration also needs to be able to read from the artifact store:
The pod needs to be authenticated to push to the container registry in your active stack.
If you configured your image builder to store the build context in the artifact store, the pod needs to be authenticated to read files from the artifact store storage.
Configure the image builder to set some required environment variables on the Kaniko build pod:
Passing additional parameters to the Kaniko build
You can pass additional parameters to the Kaniko build by setting the executor_args
attribute of the image builder.
List of some possible additional flags:
--cache
: Set tofalse
to disable caching. Defaults totrue
.--cache-dir
: Set the directory where to store cached layers. Defaults to/cache
.--cache-repo
: Set the repository where to store cached layers. Defaults togcr.io/kaniko-project/executor
.--cache-ttl
: Set the cache expiration time. Defaults to24h
.--cleanup
: Set tofalse
to disable cleanup of the working directory. Defaults totrue
.--compressed-caching
: Set tofalse
to disable compressed caching. Defaults totrue
.
Last updated