In the Docker Compose documentation, here, you have the following example related to the volumes
section of docker-compose.yml
files:
volumes:
# (1) Just specify a path and let the Engine create a volume
- /var/lib/mysql
# (2) Specify an absolute path mapping
- /opt/data:/var/lib/mysql
# (3) Path on the host, relative to the Compose file
- ./cache:/tmp/cache
# (4) User-relative path
- ~/configs:/etc/configs/:ro
# (5) Named volume
- datavolume:/var/lib/mysql
Which syntaxes produce a bind mount and which produce a docker volume? At some place of the documentation, the two concepts are strictly differentiated but at this place they are mixed together... so it is not clear to me.