From ea8cd89de9e1ca7591f095da443c1917a4083c49 Mon Sep 17 00:00:00 2001
From: Pim van Pelt <pim@ipng.nl>
Date: Sun, 11 May 2025 16:53:40 +0200
Subject: [PATCH] Update the build to multi-arch packages with buildx and qemu
 on arm64,amd64

---
 README.md | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 9d6a28a..35dc1a5 100644
--- a/README.md
+++ b/README.md
@@ -91,13 +91,28 @@ bind-mount `/etc/vpp/bootstrap.vpp`.
 
 ### Building
 
+To build, this container uses Docker's `buildx`, for which on Debian Bookworm it's required to use
+the upstream (docker.com) packages described [[here](https://docs.docker.com/engine/install/debian/)].
+To allow the buildx to build for multi-arch, it's also required to install the Qemu `binfmt`
+emulators, with:
+
+```bash
+docker run --privileged --rm tonistiigi/binfmt --install all
+```
+
+Then, ongoing builds can be cross-platform and take about 1500 seconds on an AMD64 i7-12700T
+The buildx invocation will build 'latest' and then tag it with the current VPP package release,
+which you can get from `vppcfg show version`, like so:
+
 ```bash
 IMG=git.ipng.ch/ipng/vpp-containerlab
 TAG=latest
-docker build --no-cache --build-arg REPO=release -f docker/Dockerfile -t $IMG docker/
-docker image tag $IMG $IMG:$TAG
-docker push $IMG
-docker push $IMG:$TAG
+docker buildx build --push --platform linux/arm64,linux/amd64 \
+  --tag $IMG:$TAG -f docker/Dockerfile docker/
+
+TAG=v25.02-release
+docker buildx build --push --platform linux/arm64,linux/amd64 \
+  --tag $IMG:$TAG -f docker/Dockerfile docker/
 ```
 
 ### Testing standalone container