Anyone building Docker images for amd64 on arm64 m...
# box-products
l
Anyone building Docker images for amd64 on arm64 machines? It just horrifically slow on my machine.
Copy code
➜  ~ time docker run --platform=linux/arm64 ortussolutions/commandbox:latest box version
CommandBox 5.9.0+00721
docker run --platform=linux/arm64 ortussolutions/commandbox:latest box versio  0.04s user 0.02s system 0% cpu 5.616 total

➜  ~ time docker run --platform=linux/amd64 ortussolutions/commandbox:latest box version
CommandBox 5.9.0+00721
docker run --platform=linux/amd64 ortussolutions/commandbox:latest box versio  0.05s user 0.02s system 0% cpu 1:06.95 total
The emulated amd64 machine takes about 10x as long as the native arm64 machine.
j
That is to be expected. You can run docker using Rosetta2, but it’s a separate docker daemon. I’m not sure what kind of improvement, if any, you would get.
If you’re on an ARM machine, I would suggest just sticking with the ARM image.
l
I’m building it for deployment to a AMD64 swarm
j
Do have have a CI pipeline or are you building locally and pushing to the registry.
Because Docker
buildx
will build multi-arch and then the
docker pull
will pull the correct arch image.
l
We’re prototyping, so no CI yet. Building locally and pushing to the registry.
j
OK. You’ll probably have to put up with the lag in building locally. Building
arm
on
amd
is faster. BuildX is now part of of Docker, but you can build and push one tag with multiple architectures: https://docs.docker.com/build/building/multi-platform/#building-multi-platform-images
l
Ooh, Rosetta is faster!
Copy code
➜  ~ time docker run --platform=linux/amd64 ortussolutions/commandbox:latest box version
CommandBox 5.9.0+00721
docker run --platform=linux/amd64 ortussolutions/commandbox:latest box versio  0.03s user 0.02s system 0% cpu 18.731 total
Only about a 3x slowdown!
Thanks for the tips, Jon!
🙂 1