I am working through understanding how docker-compose.yaml works. I am trying to define a volume inside the compose file and to mount it at a mount point locally. I try to run a basic .yaml to mount my volume:
version: '3.2' services: mydb: image: postgres volumes: - db-data:var/lib/postgres/data ports: - "5432:5432" volumes: - db-data: - driver: local
But when I run
docker-compose down , I get an error:
$ docker-compose down The Compose file '.\docker-compose.yml' is invalid because: services.mydb.volumes 'type' is a required property services.mydb.volumes 'type' is a required property
I am new to this and still am understanding all the nuances of working with Docker. I think that my problem is that it's an either an indention error or how I am calling the version number with the extension, but I can't seem to understand the error.