Update the build to multi-arch packages with buildx and qemu on arm64,amd64

This commit is contained in:
Pim van Pelt
2025-05-11 16:53:40 +02:00
parent 2b03aad9bc
commit ea8cd89de9

View File

@ -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