Page MenuHomePhabricator

Example `docker-compose.yml` gives warning about obsolete `version` attribute
Closed, ResolvedPublic

Description

Using Docker version 28.0.4, build b8034c0 with the example docker-compose.yml gives the following warning:

WARN[0000] /tmp/tmp-mw/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion

This is a bit disconcerting for new sysadmins. Removing the attribute without replacement would be ideal, if not prevented by WMF internal compatibility.

Event Timeline

Douginamug renamed this task from Example `docker-compose.yml` gives warning to Example `docker-compose.yml` gives warning about obsolete `version` attribute.May 2 2025, 12:03 PM

Can you please link to the file? I can't find it in mediawiki or mediawiki-docker.

I wrote some patches to get rid of "version": from Docker files a year or two ago. Here's one of them.

I think this can be marked duplicate to:

I should have searched more broadly, and tagged the other issues.

xSavitar claimed this task.
xSavitar subscribed.

Yeah that looks like a duplicate of the tasks @Douginamug mentioned above. Could you update your build and see if this is still happening? I'll close this task as duplicate but please reopen if you still face this issue.

Looking more closely, this issue is technically different, since it refers to docker _hub_. I notice the example manifest on docker hub diverges significantly from the one contained in mediawiki/core — should this be so? Intuitively it would be nice if the mediawiki/core manifest propagated to hub.

Looking more closely, this issue is technically different, since it refers to docker _hub_. I notice the example manifest on docker hub diverges significantly from the one contained in mediawiki/core — should this be so?

FWIW, at a glance, it looks like the example docker-compose.yml displayed at Docker Hub is defined at https://github.com/docker-library/docs/blob/master/mediawiki/stack.yml. (I'm not personally sure whether/to what extent it should diverge from the manifest in mediawiki/core, though)

xSavitar reopened this task as Open.EditedMay 2 2025, 2:07 PM

Actually the issue is the opposite (spoke with the reporter at the WMHackathon 2025 now) of what was reported here: T362669: docker-compose.yml `version` is now obsolete with Docker Desktop v4.29.0

The task linked above was to remove the version property from the yml file because it's obsolete but this task is about putting it back (it being absent is obsolete) which brings some confusion.

So maybe we should find a way to reconcile and decide whether to go forward with the property or not. NOTE: The docker community itself has deprecated [1] this feature and is no longer supported. This should probably be dropped from our latest images and people upgrade to the latest docker engine (?) maybe.

[1] ref. https://forums.docker.com/t/docker-compose-yml-version-is-obsolete/141313

@xSavitar I believe this issue refers to the exact same issue as T362669 and T364815, namely that the version attribute is obsolete and that docker compose as of v2.26 will give a warning. The only difference is that this issue refers to the docker-compose.yml on the docker hub example whereas the other two issues refer to the docker-compose.yml found in mediawiki/core.

I have submitted this pull request on github to remove version attribute.

Douginamug changed the task status from Open to In Progress.May 3 2025, 12:37 PM
Douginamug claimed this task.