Skip to content

docker-compose version ERROR #2

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

Closed
esmaeelE opened this issue Jan 16, 2023 · 3 comments
Closed

docker-compose version ERROR #2

esmaeelE opened this issue Jan 16, 2023 · 3 comments

Comments

@esmaeelE
Copy link
Collaborator

On Debian 11 here is the message after run docker-compose -d


$ docker-compose up -d
ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

But as it said changing
version: '3.8' -> '3.3'
will solve it.

@MaxianEdison
Copy link
Collaborator

Hi @esmaeelE
You must use latest version of docker and docker compoes to run this compose file.
please update your docker version and use docker compose up -d instead of docker-compose up -d
for more information see this

@esmaeelE
Copy link
Collaborator Author

Thanks in advance @MaxianEdison, I know it can be done but as updating a single package in stable Debian especially from non-official repository not recommend and not a choice for me.

One option is to check distribution release and then change $ version variable but it can be complicated for other type of OSes.

Maybe adding a comment to README.md file expressing something like this is better.

If you are running Debian stable please set version number to '3.3' in docker-compose.yml file.

version: '3.3'

@esmaeelE
Copy link
Collaborator Author

esmaeelE commented Jan 5, 2025

As version top-level property is obsolete in docker compose 25.05 so this issue neither relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants