Added support for ARM64 arch using buildx
This MR includes support to build and push container images compatible with the ARM64 architecture. It downloads and uses a copy of docker-buildx
retrieved from the original project. It follows the discussions held in !20 (closed).
This MR fixes #28.
Implementation Notes
- The
docker-buildx
tool does not have separatebuild
,tag
, andpush
commands like Docker has. To push images to a registry, it uses the argument--push
in thedocker-buildx build --push
command, which performs all tasks at once (build, tag, and push).- There is an open request in the original project to separate both tasks, but at this time there's no way to separate them.
- The
docker-buildx
tool does not allow to list images using a command similar todocker images
, hence the corresponding step has been removed. - To allow for testing, the line
if: $CI_PROJECT_PATH == 'antora/docker-antora' && $CI_COMMIT_BRANCH == 'main'
has changed toif: $CI_COMMIT_BRANCH == 'main'
, for obvious reasons.- Testing this MR on our project (with a different image tag
akosma/antora
) yielded this image on Docker Hub which is compatible with both ARM64 and AMD64 architectures.
- Testing this MR on our project (with a different image tag
- This MR does not refactor the structure of the
.gitlab-ci.yml
file, and does not save the final container in any other registry than Docker Hub. Such work would happen in a separate MR.
More
The inspiration for this MR comes from this blog post.
Edited by Adrian Kosmaczewski