moodlehq / moodle-docker

A docker environment for moodle developers
GNU General Public License v3.0
373 stars 244 forks source link

Document Docker CLI version requirements #243

Closed NoelDeMartin closed 3 months ago

NoelDeMartin commented 1 year ago

With a recent update, I noticed that the version: "2" declaration in compose-files does not support the use of Parameter Expansion. With version: "3" this works, but under further inspection I noticed this was working in the CI tests because they use the compose plugin and I was using an old version of the docker-compose command (which is used as a fallback).

So I guess we should either update to version: "3" or document the minimum required version of the CLI.

See https://github.com/moodlehq/moodle-docker/pull/198#issuecomment-1340842093 for more details on this.

paulholden commented 1 year ago

Because I recall having this exact conversation with @stronk7 some time ago, just adding for reference (agree it should be documented):

Old version - doesn't work:

$ docker --version
Docker version 18.09.7, build 2d0083d
$ docker-compose --version
docker-compose version 1.8.0, build unknown
$ bin/moodle-docker-compose up -d
Compose v2 is not available in Docker CLI, falling back to use docker-compose script
ERROR: Invalid interpolation format for "image" option in service "selenium": "selenium/standalone-firefox${MOODLE_DOCKER_SELENIUM_SUFFIX:-}:${MOODLE_DOCKER_BROWSER_TAG}"

Upgraded - works:

$ docker --version
Docker version 20.10.7, build f0df350
$ docker compose version
Docker Compose version v2.12.2
scara commented 1 year ago

Hi @paulholden,

$ docker-compose --version
docker-compose version 1.8.0, build unknown

vs

$ docker compose version
Docker Compose version v2.12.2

Guessing that https://github.com/docker/compose/releases/tag/v2.7.0 could be the minimum requirement. Reading https://docs.docker.com/compose/release-notes/#290 I guess that we should suggest 2.10+.

Could you give it a try, maybe 2.10.0 first and then 2.6.1, the version before 2.7.0?

No info found from the Release Notes for those still on the Compose v1 path. Edit: guessing at least 1.27.0 from https://docs.docker.com/compose/compose-file/compose-versioning/#versioning. Variable substitution was added in Compose file Version 2.

TIA, Matteo

stronk7 commented 3 months ago

Just trying to define this... some updates:

So, unless we find other couples of docker-engine (>= v19.03.0) and docker-compose (>= 1.27.0) documented... I'd propose to declare:

And done, they are near 2y old versions and should work. If anybody detects any new requirement not available in those versions, we always can raise them. In any case, I'd add to the information above that it's always recommended to try to run the latest versions (bug fixes and friends).

Not sure how that looks to you, thoughts? Maybe I'm missing something, surely I am, heh.

Ciao :-)

stronk7 commented 3 months ago

Note that there is #284 about to write down the above to docs.

We'll wait a few days to hear any objection. If nothing happens, I think that we can assume the PR as a good start point for the very-basic-requirements to be written down.

Ciao :-)