Closed Corbeno closed 2 years ago
Its actually v3.
Adding quotes around port and volume mappings is part of the 3.x spec.
See https://docs.docker.com/compose/compose-file/compose-file-v3/
It looks to me like quoted ports are possible with version 2 (see ports v2). Anyway, adding a version tag is very important. According to the first paragraph in the compose versioning docu version 1 is assumed when no version is specified.
I can't check right now, but did this behavior improve: https://stackoverflow.com/a/40158753
It looks to me like quoted ports are possible with version 2
See https://docs.docker.com/compose/compose-file/compose-file-v3/#volumes
So as I stated before https://github.com/Hetsh/docker-stationeers/pull/8#issuecomment-1183728697
I tried to validate the compose file like the stack overflow post suggested, but it did not complain no matter which version I tried. Another paragraph in the docs states that:
Top-level version property is defined by the specification for backward compatibility but is only informative.
This would fit the behavior of my validation-attempt. I suppose it would be best to leave out the version tag if it has no meaning.
Thank you anyway for the contribution @Corbeno! Now we understand docker-compose a bit better. :)
This is necessary with newer versions of docker-compose, as the "services" tag is a version 2 feature