New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] DOCKER_DEFAULT_PLATFORM environment variable not working #10041
Comments
Hi @jensschulze, thanks for the report. I'm having a hard time fully replicating your bug. What I can replicate:
What I can't replicate:
which is the expected behaviour iirc. What I think might be happening to you (happened to me while testing): When you run |
Hi @laurazard, thanks for testing and your explanation of the second case! Certainly you are right, I did not delete the I did not know that Compose chooses the platform on the basis of the image already present. When I delete the MySQL image first, I get the result you expected.
|
Hi @laurazard, possibly the detail went down, but there was still incorrect behavior that you could replicate. Is this bug being tracked elsewhere? |
Hiya @jensschulze. Sorry, I closed this prematurely 😅 I'm putting up a PR to fix the other issue today :) |
Description
I am having platform issues on a M1 MacBook pro: Docker Compose v2.13.0 (which comes bundled with Docker Desktop 4.15.0) seems to ignore the environment variable
DOCKER_DEFAULT_PLATFORM
.Environment
docker pull
no platform specified
Works as expected.
environment variable is set
Works as expected.
Steps To Reproduce
docker compose
Let’s use this super simple demo file:
No platform specified
Does not work as expected (does not complain).
Environment variable is set
Does not work as expected (complains although a default is set)
This has worked before, we are using
docker compose
every day. This behavior was introduced with the newest version of Docker Desktop. If youexport
the variable instead of setting it, the behavior is the same.In the Release notes for v2.13.0 there is even a bullet point stating:
Platform in compose file
Add the
platform
key to the compose file:… and it works:
It still works if you specifically set or export the environment variable.
This is the expected behavior, but we do not want to specify the platform in every service in the
docker-compose.yml
.Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: