Compose `version` property is obsolete
kdmccormick opened this issue · 2 comments
Bug description
As mentioned here, docker-compose now warns of a deprecated property
/home/tutor/.local/share/tutor/env/local/docker-compose.yml: `version` is obsolete
/home/tutor/.local/share/tutor/env/local/docker-compose.prod.yml: `version` is obsolete
/home/tutor/.local/share/tutor/env/local/docker-compose.jobs.yml: `version` is obsolete
How to reproduce
Run any tutor command that invokes docker-compose. tutor local run lms bash
would work.
Environment
Python 3.10.12
Compose v1.29.2 (should work with newer versions, too)
Recommended Fix
The version
property of Compose .yml files is obsolete as of 1.27 and should be removed, as described in official compose spec):
Legacy versions 2.x and 3.x of the Compose file format were merged into the Compose Specification. It is implemented in versions 1.27.0 and above (also known as Compose V2) of the Docker Compose CLI.
and again:
The top-level version property is defined by the Compose Specification for backward compatibility. It is only informative and you'll receive a warning message that it is obsolete if used.
Tutor recommends docker-compose>=2.0.0
, so we should be plenty safe to remove remove this property from all compose files. Furthermore, Tutor's DOCKER_COMPOSE_VERSION config setting is only used to set the obsolete version
property, and overriding that config version never would have been viable for end-users anyway, so I recommend removing the config setting too.
Hello, I'd like to work on this issue.
Great @jasonmokk , it's all yours! Let me know if you need any help getting started.