AmpersandTarski / Ampersand

Build database applications faster than anyone else, and keep your data pollution free as a bonus.
http://ampersandtarski.github.io/
GNU General Public License v3.0
40 stars 8 forks source link

Error response from daemon: image with reference ampersandtarski/ampersand:v4.6.2 was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64. #1284

Closed ElMakkiHaddouchi closed 1 year ago

ElMakkiHaddouchi commented 2 years ago

What happened

On my Mac (m1) I am trying the following command: docker run --platform=linux/arm64 -it -v ${pwd}:/scripts ampersandtarski/ampersand:v4.6.2 check repositoryumcu.archimate

after I tried this command, I get the following warning: WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Normally I use this command: docker run -it -v ${pwd}:/scripts ampersandtarski/ampersand:v4.6.2 check repositoryumcu.archimate And when I try adding the tag –platform=linux/amd64 to the command, the error message doesn’t appear.

What I expected

Run this image on my machine.

Version of ampersand that was used

4.6.2

Steps to reproduce

1. 2. 3. 4.

Screenshot / Video

Context / Source of ampersand script

stefjoosten commented 2 years ago

I had exactly the same issue with my MacBook Pro M1. I used the same solution, which is to add the extra option just like you did. Everything seems to work fine from that point onwards. I don't have a validated explanation for this, so I'm still curious. @ElMakkiHaddouchi do you experience any further problems after using this fix?

ElMakkiHaddouchi commented 2 years ago

@stefjoosten Nothing else happens when the command is executed. So no error message, but also no result that I expected.

When executing the command I normally get the corresponding violations with the EA model. But now no result appears.

Michiel-s commented 2 years ago

Hi @ElMakkiHaddouchi and @stefjoosten, as you can see on Docker Hub we only have images for platform linux/amd64 available. Ampersand on Docker Hub

When you run/build on your machine with --platform=linux/arm64 (notice ARM not AMD), you basically tell Docker to run image for platform ARM, but there is not an image available for that requirement.

The issue you are facing has something to do with the Apple M1 chip. Not exactly sure why, I'm not a Mac user nor expert.

I believe it is enough to only specify the OS in your case. So use --platform=linux will do.

If you need an ARM image because otherwise you cannot run on M1 (shouldn't be the case I believe), let us know. We can add additional platform builds for future releases.

hanjoosten commented 2 years ago

@Michiel-s , It might be a good idea to build these anyways?

ElMakkiHaddouchi commented 2 years ago

@ Hi Michiel-s, I modified it and tried with --platform=linux. But still an error message appears.

"docker: Error response from daemon: image with reference ampersandtarski/ampersand:v4.6.2 was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64."

I think it would be useful if a new platform is built, likewise Han Joosten also indicates.

Michiel-s commented 1 year ago

Today I did some effort in setting up a multi platform build for us. This is far from trivial.

A couple of issue I ran into:

So I propose to close this issue.

For those wanting to run the ampersandtarski/ampersand and/or ampersandtarski/prototype-framework images on Apple M1 / arm64 platform: tell your docker runtime to pull/run with --platform linux/amd64.

Keep in mind that you need to specify the --platform argument before the image. Otherwise it will not be an argument for docker but recognized as command line argument for the container itself. So docker run --platform linux/amd64 ampersandtarski/ampersand