-
Notifications
You must be signed in to change notification settings - Fork 112
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
Expose COMPOSE_PROJECT_NAME for interpolation #240
Comments
This is still an issue in latest Docker Compose v2.10.2, despite the alleged fix (#272) merged in compose-go v1.2.8 which was merged to Compose back in v2.6.1. Using the below It may also be that I'm not handling the variable properly (the documentation on this is extremely vague and confusing). What I want to do: simply use the parent directory of the I thought this functionality was added in #272 but it does not seem to be working. docker info:
/home/user/graylog-test/docker-compose.yml:
|
So I found a docker-compose.yml that works: /home/user/project1/docker-compose.yml:
This produces a network named If this behavior is detailed somewhere in the compose file reference I could not find it. |
compose-spec/compose-spec#206 introduced a top-level project name property to the compose file spec.
#231 implemented support for this property, but I believe the implementation does not yet comply with the second sentence in the spec:
From what I can see in
loader/loader.go
, determining the name happens after parsing/interpolating, and indeed: With compose version 2.3.3,${COMPOSE_PROJECT_NAME}
is only replaced when the project name is set via the COMPOSE_PROJECT_NAME env variable.If the name is set via command line parameter, the top-level name property, or left as the folder name default (all of which should work according to my interpretation of the spec text),
${COMPOSE_PROJECT_NAME}
is not replaced.Fixing this would also address the long-standing and much requested docker/compose#2294
(ping @ndeloof @ulyssessouza since you two authored the two PRs mentioned above)
The text was updated successfully, but these errors were encountered: