Sfoglia il codice sorgente

Minor doc edit to add clarity around the --volume path format
Also add a comment to the ValidatePath func so devs/reviewers
know exactly what its looking for.

Signed-off-by: Doug Davis <dug@us.ibm.com>

Doug Davis 10 anni fa
parent
commit
3fcf53db92
2 ha cambiato i file con 6 aggiunte e 2 eliminazioni
  1. 4 2
      docs/sources/reference/run.md
  2. 2 0
      opts/opts.go

+ 4 - 2
docs/sources/reference/run.md

@@ -1122,8 +1122,10 @@ container's `/etc/hosts` entry will be automatically updated.
 
 
 ## VOLUME (shared filesystems)
 ## VOLUME (shared filesystems)
 
 
-    -v=[]: Create a bind mount with: [host-dir]:[container-dir]:[rw|ro].
-           If "container-dir" is missing, then docker creates a new volume.
+    -v=[]: Create a bind mount with: [host-dir:]container-dir[:rw|ro].
+           If 'host-dir' is missing, then docker creates a new volume.
+		   If neither 'rw' or 'ro' is specified then the volume is mounted
+		   in read-write mode.
     --volumes-from="": Mount all volumes from the given container(s)
     --volumes-from="": Mount all volumes from the given container(s)
 
 
 The volumes commands are complex enough to have their own documentation
 The volumes commands are complex enough to have their own documentation

+ 2 - 0
opts/opts.go

@@ -193,6 +193,8 @@ func ValidateLink(val string) (string, error) {
 	return val, nil
 	return val, nil
 }
 }
 
 
+// ValidatePath will make sure 'val' is in the form:
+//    [host-dir:]container-path[:rw|ro]  - but doesn't validate the mode part
 func ValidatePath(val string) (string, error) {
 func ValidatePath(val string) (string, error) {
 	var containerPath string
 	var containerPath string