Docker-compose.yaml - difference between single line volumes declaration and bind type declaration

Viewed 33

Apologies if this is a dumb question but...

I am still getting to understand docker, but can't seem to find an answer to when you would use one of the following over the other in a docker-compose.yaml file:

e.g.

      volumes:
        - type: bind
          source: /c/docker/tool/log
          target: /opt/distribution/log

OR

volumes: 
            - "c:/docker/tool/log:/opt/distribution/log"

Are the above two snippets equivalent to each other? They appear to do the same job - but I am not sure if I am missing some key points with the bind version.

1 Answers
Related