Hetsh / docker-stationeers

Easy to set up stationeers server inside a docker container.
https://hub.docker.com/r/hetsh/stationeers
The Unlicense
9 stars 4 forks source link

Add version tag to compose yml #8

Closed Corbeno closed 2 years ago

Corbeno commented 2 years ago

This is necessary with newer versions of docker-compose, as the "services" tag is a version 2 feature

spannerman79 commented 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/

Hetsh commented 2 years ago

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.

Hetsh commented 2 years ago

I can't check right now, but did this behavior improve: https://stackoverflow.com/a/40158753

spannerman79 commented 2 years ago

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

Hetsh commented 2 years ago

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.

Hetsh commented 2 years ago

Thank you anyway for the contribution @Corbeno! Now we understand docker-compose a bit better. :)