-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
docker compose restricts project name, where the spec does not #9741
Comments
To add to this issue, doesn't seem like
But one would expect to get:
|
This behaviour is also observable with docker compose v2.9.0 |
I was bitten by this today, and after a little digging, found out what happened. The change was part of compose-spec/compose-go#261, which resolved #9434:
If I'm interpreting correctly, the issue is that different project names could canonicalize to the same name, leading to a conflict and surprising behavior. The solution was to enforce only canonical names to begin with, that essentially must satisfy This landed in:
cc: @paulschuetz |
PR compose-spec#261 changed `docker compose` behavior to require normalized project names as input, instead of normalizing project names automatically. This landed in compose-spec/compose-go v1.2.5 and docker/compose v2.5.1. However, the previous error message gave no indication why a name isn't valid. This is surprising for users whose previously working project names no longer work with newer versions of `docker compose`. As of compose-spec/compose-spec#314, the spec now contains the text: > Project name MUST contain only lowercase letters, decimal digits, > dashes, and underscores, and MUST begin with a lowercase letter or > decimal digit. This updated error message provides a concise version of this requirement based on regular expression character range notation. See also: - compose-spec/compose-spec#311 - docker/compose#9741 Signed-off-by: Mike Bland <mbland@acm.org>
PR compose-spec#261 changed `docker compose` behavior to require normalized project names as input, instead of normalizing project names automatically. This landed in compose-spec/compose-go v1.2.5 and docker/compose v2.5.1. However, the previous error message gave no indication why a name isn't valid. This is surprising for users whose previously working project names no longer work with newer versions of `docker compose`. As of compose-spec/compose-spec#314, the spec now contains the text: > Project name MUST contain only lowercase letters, decimal digits, > dashes, and underscores, and MUST begin with a lowercase letter or > decimal digit. This updated error message provides a concise version of this requirement based on regular expression character range notation. See also: - compose-spec/compose-spec#311 - docker/compose#9741 Signed-off-by: Mike Bland <mbland@acm.org>
Had the same issue, but was not setting a name manually. It turns out the directory name in which the |
Description
As a follow up to #9216: docker compose denies creating projects with project names containing dots or uppercase letters. Looking at the compose spec, an arbitrary string can be provided as project name. There is no obvious restriction on the project name content:
https://github.com/compose-spec/compose-spec/blob/master/spec.md?plain=1#L48-L52
https://github.com/compose-spec/compose-spec/blob/master/schema/compose-spec.json#L14-L17
Steps to reproduce the issue:
Describe the results you received:
"settings_pittsburghFL" is not a valid project name
Describe the results you expected:
Project created successfully
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker compose version
:Additional environment details:
The text was updated successfully, but these errors were encountered: