My docker-compose.yml looks like this
postgres:
container_name: postgres-container-1
image: postgres:latest
ports:
- "15432:5432"
When I try to run
docker compose up -d
I get following error
(root) Additional property postgres is not allowed
However when I run
docker-compose up -d
everything runs as intended, but I get info message that
Docker Compose is now in the Docker CLI, try `docker compose up`
So I assume that docker-compose will soon be obsolete... What did I do wrong?
I had this issue as well. This other StackOverflow post fixed it for me.
I needed the
services:
key at the top, withpostgres:
nested under it.My docker-compose.yml