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-compose 2.17.1 changes syntex limitation - will not accept stack names with a '.' #10405
Comments
I am experiencing the same problem. https://github.com/yskszk63/my-devcontainer-with-compose It is as follows.
Up to 2.17.0, it worked as follows.
|
Fixed by #10406 and released as v2.17.2. Thanks for the report! |
@milas: FWIW, I'm coming across this same issue (our project names have periods) in Docker Desktop v4.18.0 which included Docker Compose v2.17.2:
The logic checks out: a project name with periods in the name doesn't match that RegexPattern. |
Same problem here with a recent upgrade to docker desktop 4.18.0 (Docker Compose version v2.17.2) :
This is actually quite a show stopper since our project even follows the rules ! |
@bertrandgorge I think that's by design as according to #10431 uppercase violates the specifications and therefore that error is valid. What I'm not certain of right now is if periods are valid according to the spec. In my case it just say 'name is not...' without mentioning the actual name that's violating the regex. So, to be fair, I'm guessing it's the same issue of having periods in the name as @ezaton reported here. Though, full disclosure, I've been too lazy to do a minimal repro required to open a new issue. |
Ah ! I didn't see the uppercase thing ! Indeed... Thanks for the tip! (for those reading this later - in such case, it seems to be enough to put it all in lowercase, the build now works and I didn't seem to have lost my volumes) |
@bryandam If I'm understanding your case correctly, this is expected. If you have: name: my.app
services:
nginx:
image: nginx That's an invalid Compose YAML file - The reason it works on an older version is because Compose was doing automatic normalization on the |
(All that said, I am looking at improving the error messaging around schema validation, as it's rather confusing as seen in this thread) |
Thanks for the reply @milas. Since this bug was marked as 'fixed' I was assuming that the period was valid. What's confusing to me is that I'm not even specifying a name property in the root of the document. I tried adding one and that didn't fix it either. Here's my sanitized (hopefully) compose file:
|
Hm, that file seems ok, so there must be something else here. You mentioned:
Can you clarify? Is that via dir name, Also, I noticed you're running from Can you also confirm the exact error you're getting? There's several error strings that are VERY similar here unfortunately 😅 |
What I meant by project names is in the example above 'org.cloud.project.api' as those represent the VS project name and the folder for the build context. To be clear, maybe those are red-herrings ... I just know it's not uppercase because we don't use uppercase.
That's the whole thing, unmodified. Which is why I'm only guessing it's the periods and latched onto this issue. I legit don't know if periods are my actual issue because the error doesn't tell me the string it's complaining about. And again, I'm being too lazy to do a repro though so feel free to give me the finger and tell me to try harder and come back when I'm ready to actually be helpful. |
Figured it out. We had a override file that I had overlooked and it had an uppercase name element. |
So, if ".devcontainer" is not a valid stack name, and the solution was to implement proper stack name validation rules. How do we get devcontainer working again, since they required/recommend the use of .devcontainer folder in the stack. Do we need a change to devcontainer/cli to pass some other argument to docker-compose? |
I think one option would be for the devcontainer compose-file to include a |
Ok thanks, for this issue on devcontainer/cli related to this. |
Description
Regression from previous version (2.17) - a stack name which includes a '.' symbol is now considered illegal:
Example:
$ docker-compose ps
"lokal.co.il" is not a valid project name: it must contain only characters from [a-z0-9_-] and start with [a-z0-9]
Steps To Reproduce
Have a working (on previous versions) stack with a name in it:
mkdir domain.co.il
cd domain.co.il
cat << EOF > docker-compose.yaml
version: '3'
volumes:
domain_html:
networks:
web_internal:
services:
domain.co.il:
image: nginx:alpine
restart: always
volumes:
- lokal_html:/usr/share/nginx/html:ro
environment:
- VIRTUAL_HOST=domain.co.il
- VIRTUAL_PORT=80
- VIRTUAL_NETWORK=web_internal
networks:
- web_internal
logging:
driver: "json-file"
options:
max-size: "30m"
max-file: "3"
EOF
docker-compose ps (fails)
docker-compose-v2.17 ps # Returns results
Compose Version
No response
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: