synzen / MonitoRSS

MonitoRSS RSS bot (formerly known as Discord.RSS) with customizable feeds. https://monitorss.xyz
https://monitorss.xyz
MIT License
1.05k stars 237 forks source link

docker-compose.yml error #369

Closed aratane closed 5 months ago

aratane commented 5 months ago

I have followed all the steps available, but when I execute the command: docker-compose up -d an error appears:

ERROR: The Compose file './docker-compose.yml' is invalid because:
'name' does not match any of the regexes: '^x-'

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/
netux commented 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
netux commented 5 months ago

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
synzen commented 5 months ago

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)

netux commented 5 months ago

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.