How do I verify a Docker Buildx build actually uses the native node for a given platform?
I have a QEMU-base multi-platform Buildx builder called maven
on x64 Linux. To that I appended a Mac Mini as native node for Arm builds.
$ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
builder docker-container
builder0 unix:///var/run/docker.sock inactive
maven * docker-container
maven0 unix:///var/run/docker.sock running v0.11.0 linux/amd64*, linux/amd64/v2, linux/arm64, ....
mac-mini ssh://some-user@10.1.2.3 running v0.11.5 linux/arm64*, linux/amd64, linux/amd64/v2, ...
Also, I verified the setup actually works by building a "Hello World" image.
$ docker buildx build --progress plain --builder maven --platform linux/arm64,linux/amd64 --tag my-hello-world .
...
#8 [linux/arm64 internal] load metadata for docker.io/library/debian:bullseye-slim
#8 DONE 1.0s
#6 [linux/amd64 internal] load metadata for docker.io/library/debian:bullseye-slim
#6 DONE 0.9s
...
The question is: did Docker actually use the native node for the Arm build or maybe still the local QEMU "node"? The output doesn't say.
The Buildx driver docker-container
creates a moby/buildkit
container on each node. The name of the container is buildx_buildkit_<node-name>
. You can poke around that container to understand what it's doing.
Hence, either on the "local" host or on the remote Mac Mini do
$ docker ps
to verify what the container name is e.g. buildx_buildkit_mac-mini
in my case$ docker exec -ti buildx_buildkit_mac-mini sh
to get console access to that running container$ top
inside the container to monitor processesInside those containers PID 1 is always buildkitd
. Other process will be started if you start a Buildx build and Docker assigns work to this node. Examples below.