vertica / vertica-kubernetes

Operator, container and Helm chart to deploy Vertica in Kubernetes
Apache License 2.0
44 stars 25 forks source link

Adds support for Multi-Arch image builds #910

Closed narphu closed 1 month ago

narphu commented 1 month ago

This PR updates the Make targets and Dockerfiles to allow passing a TARGET_ARCH argument that allows creating a Multi-architecture image, specifically intended towards ARM64 support. This does not yet create or test the multi-arch images. That will be handled in a following PR once we verify the Dev builds. This creates one image (each with a list of manifest)e and the container runtime picks the one architecture that it matches at runtime.

We leverage the buildx support by docker (something that we already use for the operator), where passing the TARGET_ARCH into the Dockerfile can be used to generate different layers based on the architecture. https://docs.docker.com/build/building/multi-platform/, https://forums.docker.com/t/build-multi-arch-images-with-different-commands-per-architecture-in-docker-file/134795 Note that for the operator cross platform builds, we can afford to do a cross compilation based build, but for vertica-k8s we would need to use emulation based build because we already have the vertica RPM that we want to install.

Some highlights are:

narphu commented 1 month ago

Declining this in favor of https://github.com/vertica/vertica-kubernetes/pull/911 as the tests need the Dockerhub Username and Password defined in the source branch that is not from a fork.