Closed aratane closed 5 months ago
Same issue here. Tested with, to my knowledge, the latest versions of Docker
$ docker --version
Docker version 25.0.2, build 29cf629
$ docker-compose --version
docker-compose version 1.27.3, build 4092ae5d
Seems like the name
parameter should work without needing a version
parameter: Docker compose file docs.
Removing the name
field from docker-compose.yml reveals there are some things newer Docker versions don't like about it:
$ docker-compose up
ERROR: Cannot extend service 'bot-presence-service' in /home/netux/bot/discord/MonitoRSS/docker-compose.base.yml: services with 'depends_on' cannot be extended
The error
You might be seeing this error because you're using the wrong Compose file version. [...] place your service definitions at the root of the file to use version 1.
is slightly misleading because the reverse is the issue here where you're (both) using an outdated version of docker compose (that is v1). Please see the warning at the top of the docker compose installation page:
https://docs.docker.com/compose/install/
Docker's documentation refers to and describes Compose V2 functionality. Effective July 2023, Compose V1 stopped receiving updates and is no longer in new Docker Desktop releases. Compose V2 has replaced it and is now integrated into all current Docker Desktop versions. For more information, see Migrate to Compose V2.
The purpose of the pinned version is to catch problems exactly like these version mismatches, rather than obscurer errors like unsupported features (like the one you quoted)
The error is slightly misleading because the reverse is the issue here where you're (both) using an outdated version of docker compose (that is v1).
🤦 I see. And the reason why it wasn't working on the latest version of docker-compose
is because they changed the damn command for the newer versions as well.
The image is building as I write this now. Thanks for the help! I've made a small PR #370 to change the command used in the README as well.
I have followed all the steps available, but when I execute the command:
docker-compose up -d
an error appears: