Skip to content

Added support for ARM64 arch using buildx

Adrian Kosmaczewski requested to merge vshn/docker-antora:main into main

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 separate build, tag, and push commands like Docker has. To push images to a registry, it uses the argument --push in the docker-buildx build --push command, which performs all tasks at once (build, tag, and push).
  • The docker-buildx tool does not allow to list images using a command similar to docker 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 to if: $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.
  • 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

Merge request reports