-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to build multi-arch image using kaniko #786
Comments
Thank you for your question. 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 |
@jinchihe I am not sure, what you mean by 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. |
This can be achieved within a K8s cluster with Argo to orchestrate. |
#1102 is related |
GoogleContainerTools/kaniko#786 Signed-off-by: anthr76 <hello@anthonyrabbito.com>
any improvement here? Is it still not possible to build a multi arch image with Kaniko? At least, any additional info in the README would help. |
Multi-arch support in Kaniko is fundamentally difficult because of constraints in the way Kaniko works -- instead of starting containers for each step, the RUN directives in the Dockerfile are run inside Kaniko's own container, which is naturally running in only one arch. Kaniko's value comes from not needing to spawn new containers, but that's also what keeps it from making multi-arch builds easier. It may be theoretically possible to change this, but it would be a large architectural undertaking in Kaniko, which is currently understaffed. In the meantime, I suggest using docker buildx, buildah, etc., each of which have different tradeoffs in terms of required privilege, performance, and maintainer investment. |
Another workaround that probably works if one cannot afford to leave userspace:
The main downside I see is that you need some orchestration capability to 1) run kaniko on each target platform 2) likely in parallel 3) push the manifest afterwards. Yet I think building on native platforms should be faster than building within cross-arch VMs (like docker buildx and probably buildah do). For actual cross-arch builds, Kaniko's container could embed qemu and execute kaniko within some VM. Not only this would be a “large architectural undertaking” as @imjasonh said, it would also be a somewhat questionable move IMO given this probably requires some extra capabilities on the container (at least for networking). However, I wonder to which extent Kaniko could pick up some of manifest-tool's job in my suggested workaround, for instance by implementing some edit: related to #1102 (comment) |
That's what we went for, and it's pretty straightforward in GitLab CI: https://ingenuity.siemens.com/2022/07/building-a-multi-arch-container-image-in-unprivileged-containers/ |
Skaffold's latest beta-release launched support for building multi-arch images, and I have this working for Kaniko as well. You'll need to use a mixed node Kubernetes cluster containing nodes matching the build target architectures. Skaffold will iteratively run the Kaniko builder for each architecture against that architecture Pod, stitch it into a ManifestList and push the image. For example, against this test kaniko project:
|
While kaniko itself does not natively support building multi-arch container manifests, it may be used in combination with tools such as manifest-tool to create and merge seperate arch builds into a single manifest. Fixes GoogleContainerTools#1102 Fixes GoogleContainerTools#786
While kaniko itself does not natively support building multi-arch container manifests, it may be used in combination with tools such as manifest-tool to create and merge seperate arch builds into a single manifest. Fixes GoogleContainerTools#1102 Fixes GoogleContainerTools#786
While kaniko itself does not natively support building multi-arch container manifests, it may be used in combination with tools such as manifest-tool to create and merge seperate arch builds into a single manifest. Fixes GoogleContainerTools#1102 Fixes GoogleContainerTools#786
While kaniko itself does not natively support building multi-arch container manifests, it may be used in combination with tools such as manifest-tool to create and merge seperate arch builds into a single manifest. Fixes GoogleContainerTools#1102 Fixes GoogleContainerTools#786
While kaniko itself does not natively support building multi-arch container manifests, it may be used in combination with tools such as manifest-tool to create and merge seperate arch builds into a single manifest. Fixes GoogleContainerTools#1102 Fixes GoogleContainerTools#786
* Add guide on creating multi-arch manifests While kaniko itself does not natively support building multi-arch container manifests, it may be used in combination with tools such as manifest-tool to create and merge seperate arch builds into a single manifest. Fixes #1102 Fixes #786 * Add missing toc entry
Thanks for the confirmation. can I get full supported platform list?
Any other platforms as well? |
* Add guide on creating multi-arch manifests While kaniko itself does not natively support building multi-arch container manifests, it may be used in combination with tools such as manifest-tool to create and merge seperate arch builds into a single manifest. Fixes GoogleContainerTools#1102 Fixes GoogleContainerTools#786 * Add missing toc entry
/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!
The text was updated successfully, but these errors were encountered: