-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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 documentation version #10433
Conversation
hochan@hochan-node:~/Desktop/pfc/dockercompose$ sudo docker-compose up --build ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hochan222 Thank you for updating the docs. :)
Thank you @ulyssessouza for reviewing the upates. :)
@ulyssessouza I don't understand this change; I tried this example with version 3, and that worked without issues; was this problem occurring on an outdated version of docker compose? |
My version is, According to the documentation in the current version, you need to specify the version as x.x. Versioning Version 1, the legacy format. This is specified by omitting a version key at the root of the YAML. Version 2.x. This is specified with a version: '2' or version: '2.1', etc., entry at the root of the YAML. Version 3.x, the latest and recommended version, designed to be cross-compatible between Compose and the Docker Engine’s swarm mode. This is specified with a version: '3' or version: '3.1', etc., entry at the root of the YAML. Note: When specifying the Compose file version to use, make sure to specify both the major and minor numbers. If no minor version is given, 0 is used by default and not the latest minor version. As a result, features added in later versions will not be supported. For example: version: "2" version: "2.0" So I fixed it because I thought it was correct to add .0 to the back. |
Wow, compose 1.8.0 is really old; that version was released four years ago; https://github.com/docker/compose/releases/tag/1.8.0. I'd definitely recommend installing a more current version: https://docs.docker.com/compose/install/
That's correct (although there's a proposal to change the behaviour: docker/compose#7201) While there are some features that are not supported by the v3.x format, most features are supported, and I'd prefer the examples to use the v3 format where possible, because it's currently the most portable format (supported both by I think we could change these to use;
So that the latest supported v3 compose file format is filled in automatically. @ulyssessouza @usha-mandya wdyt? |
Actually the But checking the docs, looks like it's supported in V3 too. |
hochan@hochan-node:~/Desktop/pfc/dockercompose$ sudo docker-compose up --build
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a version of "2" (or "2.0") and place your service definitions under the
services
key, or omit theversion
key and place your service definitions at the root of the file to use version 1.Proposed changes
Due to the evolution of version, '3' no longer matches version in docker-compose.
Unreleased project version (optional)
Related issues (optional)
docker-compose documentation version #10451
docker-compose documentation version #10450
docker-compose documentation version #10449
docker-compose documentation version #10433 [Merged]