Reputation: 21
I've spent quite some time in the last month trying to figure out how to run colima & docker engine on my Mac Pro M2 Max as x86_64 for both.
Everything came from the missing compatible architecture (have only 'i386,x86_64') for dockerfile-maven-plugin version 1.4.13 as described here: text, text and text
This plugin is hardcoded for the moment and I can't change it to any other. In the company we use x86_64 cpu arch PC's. But instead, I want to use my Mack Book for this purpose when I try to build images using the mentioned plugin
I have tried the following
Scenario 1:
I have installed homebrew and then installed: colima and docker After this, I started colima with this argument --arch x86_64 and once I ssh to the vm, I can see that it's with x86_64 architecture. So far so good, but I stuck to start the docker engine with the same architecture. It's started by default as darwin/arm64
Scenario 2:
I have uninstalled Homebrew for arm64 and installed rosetta. Afterwards, I proceed with installing x86_64 Homebrew as: arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then I installed docker engine as: arch -x86_64 /usr/local/bin/brew install docker and thus way, it's started as darwin/amd64 (rosetta) which is what I wanted to achieve. I also have installed colima in the same way (arch -x86_64 /usr/local/bin/brew install colima). But ... when I try to start colima, I got this error message:
FATA[0000] limactl is running under rosetta, please reinstall lima with native arch
FATA[0000] lima compatibility error: error checking Lima version: exit status 1
Even this text didn't help much.
One solution could be to run the native installation of Homebrew for arm64 arch and once I start colima with --arch x86_64, to install the docker engine inside the VM (which have Ubuntu OS by default). Inside the VM I can add the configuration as /etc/docker/daemon.json and inside to put:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
. Later on, I'll make sure to add =tcp://localhost:2375 env variable into my e.g. .zshrc file on MacOS and source it.
In this way I'll have the docker engine running inside the VM which will be exposed to my Mac Terminal and I can run my build.
Does anyone else fetch simillar issue or have better solution for this ?
Upvotes: 0
Views: 1275
Reputation: 2786
Everything came from the missing compatible architecture (have only 'i386,x86_64') for dockerfile-maven-plugin version 1.4.13 as described here: text, text and text
This plugin is hardcoded for the moment and I can't change it to any other. In the company we use x86_64 cpu arch PC's. But instead, I want to use my Mack Book for this purpose when I try to build images using the mentioned plugin
You can override the dependency though in the pom file:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.6</version>
<dependencies>
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-unixsocket</artifactId>
<version>0.38.14</version>
</dependency>
</dependencies>
</plugin>
Please see for more details. https://stackoverflow.com/a/74602916/1810962
I have installed homebrew and then installed: colima and docker After this, I started colima with this argument --arch x86_64 and once I ssh to the vm, I can see that it's with x86_64 architecture. So far so good, but I stuck to start the docker engine with the same architecture. It's started by default as darwin/arm64
I don't understand this piece. The VM should be running x86_64 so the docker engine will be using that. Did you override the docker platform environment variable like:
export DOCKER_DEFAULT_PLATFORM=linux/arm64
if so, get rid of that.
Upvotes: 0