What is Kaniko?

ARTIFACTORY: How to use Kaniko to build and deploy docker images through Jenkins available on a kubernetes environment

AuthorFullName__c
Prajyot Pawase
articleNumber
000005271
ft:sourceType
Salesforce
FirstPublishedDate
2022-05-17T10:44:45Z
lastModifiedDate
2024-03-10T07:43:58Z
VersionNumber
3

Building images from a standard Dockerfile typically relies upon interactive access to a Docker daemon, which requires root access on your machine to run. This can make it difficult to build container images in environments that can’t easily or securely expose their Docker daemons, such as Kubernetes clusters (for more about this, check out the 16th oldest open Kubernetes issue).
To overcome these challenges, kaniko is introduced, an open-source tool for building container images from a Dockerfile even without privileged root access. With kaniko, we both build an image from a Dockerfile and push it to a registry. Since it doesn’t require any special privileges or permissions, you can run kaniko in a standard Kubernetes cluster, Google Kubernetes Engine, or in any environment that can’t have access to privileges or a Docker daemon.

In this blog, we will try building Docker images with Jenkins using Kubernetes as a build agent.

For this demo create a Kubernetes cluster using any of the cloud providers(GKE, EKS, AKS) or with minikube so we can install and configure Jenkins on the cluster so the dynamic kubernetes pod build agent can be used.

Also, the Artifactory instance is up and running so that we can pull/push docker images to the Docker repository.