Explorar o código

Update documentation according to opts updates

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Vincent Demeester %!s(int64=10) %!d(string=hai) anos
pai
achega
dc8b765930
Modificáronse 2 ficheiros con 30 adicións e 6 borrados
  1. 23 3
      docs/reference/commandline/run.md
  2. 7 3
      docs/userguide/dockervolumes.md

+ 23 - 3
docs/reference/commandline/run.md

@@ -208,19 +208,39 @@ An example of a file passed with `--env-file`
     # this is a comment
     # this is a comment
     TEST_APP_DEST_HOST=10.10.0.127
     TEST_APP_DEST_HOST=10.10.0.127
     TEST_APP_DEST_PORT=8888
     TEST_APP_DEST_PORT=8888
+    _TEST_BAR=FOO
+    TEST_APP_42=magic
+    helloWorld=true
+    # 123qwe=bar <- is not valid
 
 
     # pass through this variable from the caller
     # pass through this variable from the caller
     TEST_PASSTHROUGH
     TEST_PASSTHROUGH
-    $ sudo TEST_PASSTHROUGH=howdy docker run --env-file ./env.list busybox env
-    HOME=/
+    $ TEST_PASSTHROUGH=howdy docker run --env-file ./env.list busybox env
     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
     HOSTNAME=5198e0745561
     HOSTNAME=5198e0745561
     TEST_FOO=BAR
     TEST_FOO=BAR
     TEST_APP_DEST_HOST=10.10.0.127
     TEST_APP_DEST_HOST=10.10.0.127
     TEST_APP_DEST_PORT=8888
     TEST_APP_DEST_PORT=8888
+    _TEST_BAR=FOO
+    TEST_APP_42=magic
+    helloWorld=true
     TEST_PASSTHROUGH=howdy
     TEST_PASSTHROUGH=howdy
+    HOME=/root
 
 
-    $ docker run --name console -t -i ubuntu bash
+    $ docker run --env-file ./env.list busybox env
+    PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    HOSTNAME=5198e0745561
+    TEST_FOO=BAR
+    TEST_APP_DEST_HOST=10.10.0.127
+    TEST_APP_DEST_PORT=8888
+    _TEST_BAR=FOO
+    TEST_APP_42=magic
+    helloWorld=true
+    TEST_PASSTHROUGH=
+    HOME=/root
+
+> **Note**: Environment variables names must consist solely of letters, numbers,
+> and underscores - and cannot start with a number.
 
 
 A label is a a `key=value` pair that applies metadata to a container. To label a container with two labels:
 A label is a a `key=value` pair that applies metadata to a container. To label a container with two labels:
 
 

+ 7 - 3
docs/userguide/dockervolumes.md

@@ -59,6 +59,11 @@ This will create a new volume inside a container at `/webapp`.
 > You can also use the `VOLUME` instruction in a `Dockerfile` to add one or
 > You can also use the `VOLUME` instruction in a `Dockerfile` to add one or
 > more new volumes to any container created from that image.
 > more new volumes to any container created from that image.
 
 
+Docker volumes default to mount in read-write mode, but you can also set it to be mounted read-only.
+
+    $ docker run -d -P --name web -v /opt/webapp:ro training/webapp python app.py
+
+
 ### Locating a volume
 ### Locating a volume
 
 
 You can locate the volume on the host by utilizing the 'docker inspect' command.
 You can locate the volume on the host by utilizing the 'docker inspect' command.
@@ -119,8 +124,7 @@ create it for you.
 > host-dependent, so a host directory specified in a `Dockerfile` probably
 > host-dependent, so a host directory specified in a `Dockerfile` probably
 > wouldn't work on all hosts.
 > wouldn't work on all hosts.
 
 
-Docker defaults to a read-write volume but we can also mount a directory
-read-only.
+Docker volumes default to mount in read-write mode, but you can also set it to be mounted read-only.
 
 
     $ docker run -d -P --name web -v /src/webapp:/opt/webapp:ro training/webapp python app.py
     $ docker run -d -P --name web -v /src/webapp:/opt/webapp:ro training/webapp python app.py
 
 
@@ -191,7 +195,7 @@ allows you to upgrade, or effectively migrate data volumes between containers.
 > volumes that are no longer referenced by a container.
 > volumes that are no longer referenced by a container.
 > Dangling volumes are difficult to get rid of and can take up a large amount
 > Dangling volumes are difficult to get rid of and can take up a large amount
 > of disk space. We're working on improving volume management and you can check
 > of disk space. We're working on improving volume management and you can check
-> progress on this in [pull request #8484](https://github.com/docker/docker/pull/8484)
+> progress on this in [pull request #14214](https://github.com/docker/docker/pull/14214)
 
 
 ## Backup, restore, or migrate data volumes
 ## Backup, restore, or migrate data volumes