Merge pull request #14727 from vdemeester/opts-docs-updates

Update documentation according to opts updates (#13694)
This commit is contained in:
Sebastiaan van Stijn 2015-07-21 14:19:29 +02:00
commit 1e9394103c
2 changed files with 30 additions and 6 deletions

View File

@ -208,19 +208,39 @@ An example of a file passed with `--env-file`
# this is a comment
TEST_APP_DEST_HOST=10.10.0.127
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
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
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=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:

View File

@ -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
> 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
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
> 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
@ -191,7 +195,7 @@ allows you to upgrade, or effectively migrate data volumes between containers.
> volumes that are no longer referenced by a container.
> 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
> 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