Closed mricos closed 2 weeks ago
Please upgrade with latest release (v2.27.1) and confirm this issue is still relevant
AFAICT this is the expected behavior: as you declare a service with a profile, this one is excluded from model until profile is explicitly selected. This is what profiles are all about. Please note you can enable all profiles by running :
docker compose --profile="*" config
Description
Adding
profiles
todocker-compose.yml
breaks the configuration. The same configuration withoutprofiles
works correctly.Docker Compose Version
Environment
Additional Information
Possible Workarounds
None identified. The issue appears specific to the use of
profiles
in the Docker Compose configuration.Conclusion
This bug prevents the use of profiles in Docker Compose, impacting configurations that rely on environment-specific setups.
Steps To Reproduce
Steps to Reproduce
Working Example (Without Profiles)
Create a
docker-compose.yml
file with the following content:Commands:
Expected Output:
Broken Example (With Profiles)
Create a
docker-compose.yml
file with the following content:Commands:
Actual Output:
Expected Output:
Compose Version
Docker Environment
Anything else?
Works without error as expected with docker-compose config
docker-compose version 1.29.2, build unknown docker-py version: 5.0.3 CPython version: 3.10.12 OpenSSL version: OpenSSL 3.0.2 15 Mar 2022