Kaniko: how to build multi-arch image using kaniko

Created on 20 Sep 2019  路  8Comments  路  Source: GoogleContainerTools/kaniko

/question

Hello, this is a question, is that kaniko support build multi-arch images? how to build multi-arch image using kaniko? Any docs or best practice? Thanks a lot!

Refer to build multi-arch image by using Google Cloud Build: https://medium.com/@bamnet/building-multiarch-docker-images-8a70002b3476

Thank you again!

areusability kinfeature-request kinquestion

Most helpful comment

@tejal29 should this be re-opened or point out if kaniko supports it or not.

All 8 comments

Thank you for your question.
You can pass in docker args to kaniko --build-arg opts="CGO_ENABLED=0 GOARCH=amd64" in the kaniko pod spec https://github.com/GoogleContainerTools/kaniko#using-kaniko

You will have create one kaniko pod per architecture.

Does that help?

@tejal29 Thanks. That's crosee building you pointed out. If we want to support multi-arch image, I think kaniko need support to create minifest, please see here for details abour multi-arch image: https://lobradov.github.io/Building-docker-multiarch-images/

@jinchihe I am not sure, what you mean by minifest.
I went through the doc and looks like the guidance is to create a 1 docker file per architecture.
Kaniko currently only supports 1 dockerfile per run.
You will have to create a build.sh which runs a kaniko pod instead
https://lobradov.github.io/Building-docker-multiarch-images/#same-dockerfile-template

I am going to close this for now. Please re-open if this does not answer your question.

@tejal29 take a look at how buildkit is doing it. You can use a single Dockerfile for multiple architectures and then all images get pushed into the same tag. https://engineering.docker.com/2019/04/multi-arch-images/

@tejal29 should this be re-opened or point out if kaniko supports it or not.

@tejal29, any news on that?

currently we don't support building multi-arch docker images.
We love any contributions or designs for this feature.

This can be achieved within a K8s cluster with Argo to orchestrate.
https://flavio.castelli.me/2020/10/05/build-multi-architecture-container-images-using-argo-workflow/
in this example, buildah can be replaced by kaniko for the image build, but I'm not sure for the manifest, need to check that.

Was this page helpful?
0 / 5 - 0 ratings