I am trying to Build a Ruby On Rails project inside of a Docker Compose. I got it working for the most part but for some reason I am having trouble with
docker compose up when running. It will fail after the build, but then if I rerun the
docker compose up it will succeed with no problem.
failed to solve: no match for platform in manifest
Basic Docker Compose file
- pg_isready -d test-db
- redis-cli ping
entrypoint: 'rails db:setup && rails s'
My OS: 13.4.1 (22F82) M1 Pro
Docker Version: Docker version 24.0.2, build cb74dfc
Changing platform to
linux/amd64 didn’t seem to make a difference either for whatever reason.
Use Virtualization framework
Use Rosetta for x86/amd64 emulation on Apple Silicon (Checking or unchecking this doesn’t seem to make a difference)
I’m not sure about the issue, but the platform for amd64 images is usually
linux/x86_64 so if there is a bug of recognizing the alias, that could be a reason.
You can also try to set the platform in the build section:
platforms defines a list of target platforms.
platforms attribute is omitted, Compose includes the service’s platform in the list of the default build target platforms.
platforms attribute is defined, Compose includes the service’s platform, otherwise users won’t be able to run images they built.
Composes reports an error in the following cases:
- when the list contains multiple platforms but the implementation is incapable of storing multi-platform images
- when the list contains an unsupported platform
It is also possible that the base image just doesn’t support the architecture and it will build the image for the supported architecture the second time (still could be a bug).
In case of Docker Desktop, the version of Docker Desktop is more important. Can you share that too? Based on the Docker version I guess you are using the latest version, but I don’t remember the Docker version in the desktop previous version so I’m not sure.
Here is that setup:
Credential Helper: v0.7.0