From 3ee41c3fec5ca1b70222ca48c19fb9df88116c52 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Thu, 14 Aug 2025 09:13:01 +0200 Subject: [PATCH] Explain steps to build Dockerfiles without BuildKit The Dockerfiles are reused for building on different architectures (amd64/arm64). They differ, though, on some steps for downloading or installing platform-specific utilities. This is handled automatically when using BuildKit, which is the default in docker versions v23.0+. Older docker versions require some special settings. Explain this in the README. Closes: #973 --- docker/README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docker/README.md b/docker/README.md index 36ec65698a..ecd0a043a1 100644 --- a/docker/README.md +++ b/docker/README.md @@ -91,6 +91,24 @@ For more details regarding the build on an Openshift Cluster, see [OpenShift REA * `docker-ce` installed * Pulling `ubuntu:jammy` from DockerHub +The docker files in this directory rely on [automatic Docker platform +arguments](https://docs.docker.com/reference/dockerfile/#automatic-platform-args-in-the-global-scope) +`TARGETARCH` and `TARGETPLATFORM` to be defined. This is the case when using +[BuildKit](https://docs.docker.com/build/buildkit/), which is automatically +enabled in newer (v23.0+) docker versions. + +If you are running an older version of docker that does not have BuildKit +enabled and do not wish to upgrade to a newer docker version, you have two +possibilities: + +1. [Enable BuildKit](https://docs.docker.com/build/buildkit/#getting-started) + when building: `DOCKER_BUILDKIT=1 docker build ...` +2. You should be able to define these variables manually. + - x86: `docker build --build-arg TARGETARCH=amd64 --build-arg + TARGETPLATFORM=linux/amd64 ...` + - arm: `docker build --build-arg TARGETARCH=arm64 --build-arg + TARGETPLATFORM=linux/arm64 ...` + ## 3.2. Building the shared images ## There are two shared images: one that has all dependencies, and a second that compiles all targets (eNB, gNB, [nr]UE).