Setting up Orbstack to build multi-platform container Images
It’s been a few months since I’ve switched to using Orbstack as an alternative to Docker Desktop. Main reason being that I wanted to take advantage of their improved speed on MacOS and the ability to create Linux machines as well. The team has shared a comparison sheet which may help you decide if it’s worth the switch.
Issues building or running container images that need Intel CPU architecture
Recently, I was working on a project, where the container images had to be built with support for Intel CPU (x86_64/amd64). When trying to build the image, I got the following error:
$ docker build --platform linux/amd64 -t lambda-image .
# output snipped
---
> [build-base 2/4] RUN corepack enable:
0.077 Fatal glibc error: CPU does not support x86-64-v2
------
Dockerfile:12
--------------------
# output snipped
ERROR: failed to solve: process "/bin/sh -c corepack enable" did not complete successfully: exit code: 127
The same error message Fatal glibc error: CPU does not support x86-64-v2
was shown when trying to run any image with docker run...
, that only had Intel CPU images available.
Enabling support for Intel CPU emulation
Going through the Orbstack Docs, it mentioned that it uses Rosetta under the hood to support multi-architectures.
To do check the Orbstack configuration you can check the Orbstack configuration to make sure it uses Rosetta. On my install, I noticed that this was disabled.
$ orb config show
cpu: 10
docker.node_name: orbstack
docker.set_context: true
k8s.enable: false
k8s.expose_services: false
machine.docker.username: muhannad
memory_mib: 8192
mount_hide_shared: false
network.https: true
network_bridge: true
network_proxy: auto
rosetta: false
setup.use_admin: true
ssh.expose_port: false
Turns out you can easily enable it to use Rosetta using the following commands:
$ orb config set rosetta true
Restart OrbStack with "orb stop" to apply changes.
# restart Orbstack
$ orb stop && orb start
Now Orbstack is able to run Intel CPU based images without any issue.
Hope this post was helpful to those trying to work with multi-architecture images using Orbstack. Let me know on X any interesting way you use Orbstack.