Hi guys,
i wanted to recreate a container.
This is the docker-compose.yml:
Use postgres/example user/password credentials
version: ‘3.1’
services:
db:
image: postgres:11-alpine
restart: always
volumes:
- /var/lib/docker/volumes/geneious-db:/var/lib/pgsql/data
environment:
POSTGRES_PASSWORD: xxxxxxxxx
TZ: Europe/Berlin
POSTGRES_DB: geneious
PGDATA: /var/lib/postgresql/data
ports:
- 5432:5432
volumes:
/var/lib/docker/volumes/geneious-db:
When i issue “docker compose up -d” i get:
volumes Additional property /var/lib/docker/volumes/geneious-db is not allowed
When i comment the volumes section it runs.
But i need the volume, i’d like to have the database files outside the container.
I remember using this yml-file already several times. I have the impression that there is something left from the these tries, but i don’t know how to get rid off it.
The folder /var/lib/docker/volumes/geneious-db exist.
While googleing i found “docker compose up --remove-orphans”, but i get the same error.
I also found that there are “normal” volumes and “named” ones.
Which are to prefer ?
Bernd