Skip to content

Commit

Permalink
docs(ct-base): add notes about multiarch builds #8932
Browse files Browse the repository at this point in the history
Addin description on requirements to build cross platform
added as subsection of the build instructions seemed valuable.
  • Loading branch information
poikilotherm committed Sep 19, 2022
1 parent 4dfbb28 commit 6d8571b
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions doc/sphinx-guides/source/container/base-image.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ The base image provides:
- `Jattach <https://github.com/apangin/jattach>`__ (attach to running JVM)
- `dumb-init <https://github.com/Yelp/dumb-init>`__ (see :ref:`below <base-entrypoint>` for details)

This image is created as a "multi-arch image", supporting the most common architectures Dataverse usually runs on:
AMD64 (Windows/Linux/...) and ARM64 (Apple M1/M2).
This image is created as a "multi-arch image", see :ref:`below <base-multiarch>`.

It inherits being built on an Ubuntu environment from the upstream
`base image of Eclipse Temurin <https://hub.docker.com/_/eclipse-temurin>`_.
Expand Down Expand Up @@ -86,6 +85,24 @@ its sources plus uncached scheduled nightly builds to make sure security updates
*Note:* For the Github Action to be able to push to Docker Hub, two repository secrets
(DOCKERHUB_USERNAME, DOCKERHUB_TOKEN) have been added by IQSS admins to their repository.

.. _base-multiarch:

Processor Architecture and Multiarch
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This image is created as a "multi-arch image", supporting the most common architectures Dataverse usually runs on:
AMD64 (Windows/Linux/...) and ARM64 (Apple M1/M2), by using Maven Docker Plugin's *BuildX* mode.

Building the image via ``mvn -Pct package`` or ``mvn -Pct install`` as above will only build for the architecture of
the Docker maschine's CPU.

Only ``mvn -Pct deploy`` will trigger building on all enabled architectures.
Yet, to enable building with non-native code on your build machine, you will need to setup a cross-platform builder.

On Linux, you should install `qemu-user-static <https://github.com/multiarch/qemu-user-static>`__ (preferably via
your package management) on the host and run ``docker run --rm --privileged multiarch/qemu-user-static --reset -p yes``
to enable that builder. The Docker plugin will setup everything else for you.



Tunables
Expand Down Expand Up @@ -290,8 +307,6 @@ you can read about those in a few places like https://developers.redhat.com/arti
https://www.eclipse.org/openj9/docs/xxusecontainersupport, etc. The other memory defaults are inspired
from `run-java-sh recommendations`_.

*Note: the build process used the newer ``buildx`` feature of Docker to provide multiarch images.*



.. _Pre/postboot script docs: https://docs.payara.fish/community/docs/Technical%20Documentation/Payara%20Micro%20Documentation/Payara%20Micro%20Configuration%20and%20Management/Micro%20Management/Asadmin%20Commands/Pre%20and%20Post%20Boot%20Commands.html
Expand Down

0 comments on commit 6d8571b

Please sign in to comment.