
If you use -v or -volume to bind-mount a file or directory that does not Differences between -v and -mount behaviorīecause the -v and -volume flags have been a part of Docker for a long The examples below show both the -mount and -v syntax where possible, and

Tip: New users should use the -mount syntax. Here is a comparison of the syntax for each flag. The -v syntax combines all the options together in one field, while the -mount In general, -mount is more explicit and verbose. You can’t use Docker CLI commands to directly If you are developing new Docker applications, consider using

They rely on the host machine’s filesystem having a specific directory structureĪvailable. It isĬreated on demand if it does not yet exist. The file or directory does not need to exist on the Docker host already. By contrast, when you use a volume, a new directory is created withinĭocker’s storage directory on the host machine, and Docker manages that The file or directory is referenced by its absolute path on the host Mount, a file or directory on the host machine is mounted into a container. Limited functionality compared to volumes. Bind mounts have been around since the early days of Docker.
