Open rsegal opened 6 months ago
Hello @rsegal, is it right steps to reproduce it?
Dockerfile1:
FROM alpine
Dockerfile2:
FROM --platform=linux/amd64 alpine
services:
one:
build:
context: .
dockerfile: Dockerfile1
depends_on:
- two
two:
build:
context: .
dockerfile: Dockerfile2
docker compose create
:
! two The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
second execution gives no error
In my case the FROM invocations didn't specify the platform. (They were FROM mysql:8
and FROM wordpress:php7.4
for completeness.)
Rather, platform was specified in the docker compose file; both services had the argument platform: linux/arm64
.
My inference is that my computer (being an old MBP) built the two images individually for itself, linux/amd64
. Then in the docker compose call, because it explicitly was looking for a different platform it never considered those locally built images.
Description
Current behavior:
Running
docker compose create
anddocker compose --verbose create
silently fail to use a local image, and then loudly fail downstream when it can't pull that image;even though both <service 1> and <service 2> are built images that I can see with
docker image ls
. However, when I force compose to use local images withdocker compose create --pull never
, it reports the root cause:And in fact the service blocks specified
platform:linux/arm64
while I was trying to build onlinux/amd64
. Removing those lines allowed the build to succeed.Expected behavior:
When running with the
--verbose
flag, the platform error is printed regardless of whether--pull never
is specified. Running without--verbose
could print the error without--pull never
but probably doesn't.Steps To Reproduce
linux/arm64
(instead of yourlinux/amd64
)docker image ls
)docker compose create
docker compose --verbose create
docker compose create --pull never
Compose Version
Docker Environment
Anything else?
No response