blob: 01ed35050908295d1a047cf646abd30125fb5296 [file] [log] [blame]
Tom Rini04549e92021-03-15 13:19:01 -04001GitLab CI / U-Boot runner container
2===================================
3
Simon Glass7aafac02024-11-27 11:17:26 -06004In order to have a reproducible and portable build environment for CI we use a container for building in. This means that developers can also reproduce the CI environment, to a large degree at least, locally. This file is located in the tools/docker directory.
5
6The docker image supports both amd64 and arm64. Ensure that the
Tom Rini66dd5652024-12-08 11:07:31 -06007`buildx` Docker CLI plugin is installed. This is often available in your
8distribution via the 'docker-buildx' or 'docker-buildx-plugin' package.
Simon Glass7aafac02024-11-27 11:17:26 -06009
10You will need a multi-platform container, otherwise this error is shown::
11
12 ERROR: Multi-platform build is not supported for the docker driver.
13 Switch to a different driver, or turn on the containerd image store, and try again.
14
Tom Rini66dd5652024-12-08 11:07:31 -060015You can add a simple one with::
Simon Glass7aafac02024-11-27 11:17:26 -060016
17 sudo docker buildx create --name multiarch --driver docker-container --use
18
Tom Rini66dd5652024-12-08 11:07:31 -060019This will result in a builder that will use QEMU for the non-native
20architectures request in a build. While both amd64 and arm64 happen in
21parallel, the non-native part will take considerably longer as it must use QEMU
22to emulate the foreign code. An alternative, if you have accesss to reasonably
23fast amd64 (i.e. 64-bit x86) and arm64 machines is::
24
25 sudo docker buildx create --name multiarch-multinode --node localNode --bootstrap --use
26 sudo docker buildx create --name multiarch-multinode --append --node remoteNode --bootstrap ssh://user@host
27
28And this will result in a builder named multiarch-multinode that will build
29each platform natively on each node.
Simon Glass7aafac02024-11-27 11:17:26 -060030
31To build the image yourself::
Tom Rini04549e92021-03-15 13:19:01 -040032
33.. code-block:: bash
34
Simon Glass7aafac02024-11-27 11:17:26 -060035 sudo docker buildx build --platform linux/arm64/v8,linux/amd64 -t your-namespace:your-tag .
Tom Rini04549e92021-03-15 13:19:01 -040036
37Or to use an existing container
38
39.. code-block:: bash
40
Mattijs Korpershoek7fe617c2024-04-05 08:16:19 +020041 sudo docker pull trini/u-boot-gitlab-ci-runner:jammy-20240227-14Mar2024