HOME BLOG

How to build and deploy application container images with Skaffold and Kaniko

Posted on: January 19th, 2022 by Olu No Comments

Hi folks,

In this post I talk about an interesting way to build your application Docker containers and deploy them into your artifact repository e.g. Artifactory. These tools are useful if you use Kubernetes to orchestrate your container deployment.

You can perform builds using a tool called Skaffold. Skaffold can be used in multiple ways. You can perform your build one-time or you can have Skaffold watch your project and automatically build Docker containers when the code changes. Read more about Skaffold here.

Kaniko is a tool to build container images from a Dockerfile, inside a container or Kubernetes cluster. Kaniko doesn’t depend on a Docker daemon and executes within a Dockerfile completely in userspace. This allows us to easily build container images in environments where it’s not convenient to run a Docker daemon e.g. in a standard Kubernetes cluster. Read more about Kaniko here

Using these two tools together you can have your CI server build and deploy app containers to your artifact repo when certain events occur e.g. when code is merged into your development branch.

That’s all for now. Till next time. Happy software dev.

References

1. Skaffold. https://skaffold.dev/
2. Kaniko. https://github.com/GoogleContainerTools/kaniko

Leave a Reply