Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker-compose.yml: version is obsolete #5797

Open
5 tasks done
bersierj opened this issue Mar 20, 2024 · 11 comments · May be fixed by #5877
Open
5 tasks done

docker-compose.yml: version is obsolete #5797

bersierj opened this issue Mar 20, 2024 · 11 comments · May be fixed by #5877
Labels

Comments

@bersierj
Copy link

Contribution guidelines

I've found a bug and checked that ...

  • ... I understand that not following the below instructions will result in immediate closure and/or deletion of my issue.
  • ... I have understood that this bug report is dedicated for bugs, and not for support-related inquiries.
  • ... I have understood that answers are voluntary and community-driven, and not commercial support.
  • ... I have verified that my issue has not been already answered in the past. I also checked previous issues.

Description

With docker version 25.05 the version 2.1 in docker-compose.yml will be obsolete

Logs:

docker-compose.yml: `version` is obsolete

Steps to reproduce:

N/A

Which branch are you using?

master

Which architecture are you using?

x86

Operating System:

rocky linux 9

Server/VM specifications:

12GB/4 Core

Is Apparmor, SELinux or similar active?

yes

Virtualization technology:

kvm

Docker version:

25.0.5

docker-compose version or docker compose version:

v2.25.0

mailcow version:

2024-02

Reverse proxy:

Nginx

Logs of git diff:

N/A

Logs of iptables -L -vn:

N/A

Logs of ip6tables -L -vn:

N/A

Logs of iptables -L -vn -t nat:

N/A

Logs of ip6tables -L -vn -t nat:

N/A

DNS check:

N/A
@bersierj bersierj added the bug label Mar 20, 2024
@nabeeltahir785
Copy link

Please remove the version line from the docker-compose.yml file and verify that everything still works correctly on your end. Docker has made this line obsolete, which is likely the reason you're facing this issue

@conjunrad
Copy link

@nabeeltahir785 from which version of docker this line obsolete?

@bersierj
Copy link
Author

If line is removed the warning go away.
the warning start with version 25.05

@Cl-Chris
Copy link

Compose doesn't use version to select an exact schema to validate the Compose file. See https://github.com/compose-spec/compose-spec/blob/master/04-version-and-name.md
So removing the first line version: '2.1' at the beginning of docker-compose.yml and docker-compose.override.yml (if exist) solve the problem.
This not specific to MailCow.

@damianszczepanik
Copy link

Is there any way to ignore this particular warning as long as I upgrade all docker-compose.yml files? Any flag for that?

@bersierj
Copy link
Author

Is there any way to ignore this particular warning as long as I upgrade all docker-compose.yml files? Any flag for that?

Yes you can comment out the line or remove the line

@MAGICCC
Copy link
Member

MAGICCC commented Mar 26, 2024

Seems we can remove this @DerLinkman. Seeing on https://docs.docker.com/compose/compose-file/04-version-and-name/#version-top-level-element-optional it's optional (now).

seungwonleee added a commit to Toollit/client that referenced this issue Mar 28, 2024
…rod.yml: `version` is obsolete" error

- docker-compose.prod.yml delete version line
- reference: mailcow/mailcow-dockerized#5797 (comment)
@abferm
Copy link

abferm commented Mar 28, 2024

Some of my compose files need to remain compatible with older versions of docker/docker-compose. Is there any way to silence the warning without modifying the compose files?

@caoliang1918
Copy link

may be this issues can help you, jasonacox/Powerwall-Dashboard#453 (comment)

@melroy89
Copy link

melroy89 commented Apr 1, 2024

@nabeeltahir785 from which version of docker this line obsolete?

version: "x.x.x" 

@elnath78
Copy link

@Cl-Chris

Compose doesn't use version to select an exact schema to validate the Compose file. See https://github.com/compose-spec/compose-spec/blob/master/04-version-and-name.md So removing the first line version: '2.1' at the beginning of docker-compose.yml and docker-compose.override.yml (if exist) solve the problem. This not specific to MailCow.

Why the examples still have the Version lines then? Also on Gitpod is not giving this problem.

KevinHuSh pushed a commit to infiniflow/ragflow that referenced this issue Apr 15, 2024
### What problem does this PR solve?

![image](https://github.com/infiniflow/ragflow/assets/106524776/56eec972-e92a-4cd2-92cc-4c20ba478a52)

- remove version top-level element in the compose.yml file
when use command `docker compose -f docker-compose-CN.yml up -d` ,it
will waring,[maybe it appear after
v25,5](mailcow/mailcow-dockerized#5797 (comment))

![image](https://github.com/infiniflow/ragflow/assets/106524776/e42ebfb7-d51e-4423-b6dd-3a7568a6be4f)

ref to
https://docs.docker.com/compose/intro/history/#docker-compose-cli-versioning
> Version one of the Docker Compose command-line binary was first
released in 2014. It was written in Python, and is invoked with
docker-compose. Typically, Compose V1 projects include a top-level
version element in the compose.yml file, with values ranging from 2.0 to
3.8, which refer to the specific [file
formats](https://docs.docker.com/compose/intro/history/#compose-file-format-versioning).

> Version two of the Docker Compose command-line binary was announced in
2020, is written in Go, and is invoked with docker compose. Compose V2
ignores the version top-level element in the compose.yml file.
 
Also in `README.MD` show `Docker >= 24.0.0 & Docker Compose >= v2.26.1`.
so i want to remove the version.

### Type of change

- [x] Other (please describe):
remove warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants