Browse code

Merge pull request #28778 from Microsoft/jjh/volumenote

Windows: Note about volumes in run

Sebastiaan van Stijn authored on 2016/11/30 01:40:54
Showing 1 changed files
... ...
@@ -262,6 +262,26 @@ https://docs.docker.com/engine/installation/binaries/#/get-the-linux-binary)),
262 262
 you give the container the full access to create and manipulate the host's
263 263
 Docker daemon.
264 264
 
265
+On Windows, the paths must be specified using Windows-style semantics. 
266
+
267
+    PS C:\> docker run -v c:\foo:c:\dest microsoft/nanoserver cmd /s /c type c:\dest\somefile.txt
268
+    Contents of file
269
+	
270
+    PS C:\> docker run -v c:\foo:d: microsoft/nanoserver cmd /s /c type d:\somefile.txt
271
+    Contents of file
272
+
273
+The following examples will fail when using Windows-based containers, as the 
274
+destination of a volume or bind-mount inside the container must be one of: 
275
+a non-existing or empty directory; or a drive other than C:. Further, the source
276
+of a bind mount must be a local directory, not a file.
277
+
278
+    net use z: \\remotemachine\share
279
+    docker run -v z:\foo:c:\dest ...
280
+    docker run -v \\uncpath\to\directory:c:\dest ...
281
+    docker run -v c:\foo\somefile.txt:c:\dest ...
282
+    docker run -v c:\foo:c: ...
283
+    docker run -v c:\foo:c:\existing-directory-with-contents ...
284
+
265 285
 For in-depth information about volumes, refer to [manage data in containers](https://docs.docker.com/engine/tutorials/dockervolumes/)
266 286
 
267 287
 ### Add bind-mounts or volumes using the --mount flag