You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/get-started/docker-concepts/running-containers/sharing-local-files.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ Here's a way to use `docker run` to start a container using a bind mount and map
38
38
$ docker run -v /HOST/PATH:/CONTAINER/PATH -it nginx
39
39
```
40
40
41
-
The `--mount` flag offers more advanced features and granular control, making it suitable for complex mount scenarios or production deployments. If you use `--mount` to bind-mount a file or directory that doesn't yet exist on the Docker host, the `docker run` command doesn't automatically create it for you but generates an error.
41
+
The `--mount` flag offers more advanced features and granular control, making it suitable for complex mount scenarios or production deployments. By default, if you use `--mount` to bind-mount a file or directory that doesn't yet exist on the Docker host, the `docker run` command doesn't automatically create it for you but generates an error.
42
42
43
43
```console
44
44
$ docker run --mount type=bind,source=/HOST/PATH,target=/CONTAINER/PATH,readonly nginx
|`source`, `src`| The location of the file or directory on the host. This can be an absolute or relative path. |
120
+
|`destination`, `dst`, `target`| The path where the file or directory is mounted in the container. Must be an absolute path. |
121
+
|`readonly`, `ro`| If present, causes the bind mount to be [mounted into the container as read-only](#use-a-read-only-bind-mount). |
122
+
|`bind-propagation`| If present, changes the [bind propagation](#configure-bind-propagation). |
123
+
|`bind-create-src`| Automatically creates the source directory on the host if it doesn't exist. By default, `--mount` produces an error if the source path doesn't exist on the daemon. |
116
124
117
125
```console {title="Example"}
118
126
$ docker run --mount type=bind,src=.,dst=/project,ro,bind-propagation=rshared
0 commit comments