-
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
[BUG] YAML top-level name linter does not accept env variables #11787
Comments
My apologies, the enter key simply posted the issue.... |
Reached out to verdaccio Discord https://discord.com/channels/388674437219745793/1235628971224465478 Docker-compose linting error, issue opened: docker/compose#11787
See docker/compose#11787 Added default variable values
Quick workaround: To set project name from .env file, better use |
@ndeloof thanks! |
Closing as "not planned". |
No problem with closing this issue, but the interpolation does work, the linter is the only one showing error. The project name parses correctly with the interpolated variable |
Ok, I misunderstood. |
Exactly, I understand why it's unplanned, and that the json schema cannot really validate the interpolated variables The solution provided, however, works great! |
Description
Within the docker-compose.yml
While any other property accepts ${VARIABLES} from .env, the name property shows the error:
String does not match the pattern of "^[a-z0-9][a-z0-9_-]*$".yaml-schema: docker-compose.yml
Source: compose-spec.json
The variable still works, and the containers do open under the project name specified in the .env file - The error is in the linting itself
Steps To Reproduce
Create a .env file with a variable defined for the compose project name
Create a compose yml with the top-level name property set to a .env variable
Run the compose
docker compose up
The container will open under the project defined in .env, but the YML file will show the error described above
Compose Version
Docker Compose version v2.26.1-desktop.1
docker-compose version 1.29.2, build 5becea4
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
(Using docker compose)
Docker Environment
The text was updated successfully, but these errors were encountered: