Why DockerHub is recommended for Multi-Arch
DockerHub is the mainstream popular docker registry which can support Manifest List, therefore can support Multi-Arch.
Successful Story
Dockerhub is now integrated in Akraino. The validation project is already pushing to Dockerhub, so if you would like to check out some template code, please take a look at ci-management/jjb/validation.
The docker images are in the official repo now [1] and the docker build jobs passing [2].
[1] https://hub.docker.com/r/akraino/validation/
[2] https://jenkins.akraino.org/view/validation/job/validation-master-docker/
Other open source projects can refer this successful experience to integrate your DockerHub.
How to Connect Jenkins to DockerHub
The Jenkins slaves are connected to Dockerhub through the LF scripts and no extra steps are needed from users.
How to setup Jenkins
Docker needs to be installed on the Jenkins slave building the containers.
Docker file and image naming specifics to support Multi-Arch (Instruction Set Architecture)
Images that support multi-arch are handled with manifest list (a.k.a. fat manifest) mechanism.
When building an image for a specific arch, the arch is added in the tag of the image (e.g. akraino/validation:k8s-amd64-latest and akraino/validation:k8s-arm64-latest).
After the images are pushed in the dockerhub repo, the manifest can be created from the two images. Its name will be the same as the two images but with the arch removed from the tag (e.g. akraino/validation:k8s-latest).
When pulling the image, the name of the manifest is used (e.g. akraino/validation:k8s-latest); the correct image will be pulled based on the architecture of the host from which the pull is made.
To check the commands used to build, push and create the manifest in the Akraino validation project, check the build.mk and README files.