support for `docker run` environment variables file

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
master
Vincent Batts 2014-02-16 19:24:22 -05:00 committed by Tibor Vass
parent 1c21055985
commit f29511550b
1 changed files with 12 additions and 0 deletions

View File

@ -1152,6 +1152,7 @@ image is removed.
--cidfile="": Write the container ID to the file
-d, --detach=false: Detached mode: Run container in the background, print new container id
-e, --env=[]: Set environment variables
--envfile="": Read in a line delimited file of ENV variables
-h, --hostname="": Container host name
-i, --interactive=false: Keep stdin open even if not attached
--privileged=false: Give extended privileges to this container
@ -1284,6 +1285,17 @@ This exposes port ``80`` of the container for use within a link without
publishing the port to the host system's interfaces. :ref:`port_redirection`
explains in detail how to manipulate ports in Docker.
.. code-block:: bash
$ sudo docker run -e MYVAR1 --env MYVAR2=foo --envfile ./env.list ubuntu bash
This sets environmental variables to the container. For illustration all three
flags are shown here. Where -e and --env can be repeated, take an environment
variable and value, or if no "=" is provided, then that variable's current
value is passed through (i.e. $MYVAR1 from the host is set to $MYVAR1 in the
container). The --envfile flag takes a filename as an argument and expects each
line to be a VAR=VAL format.
.. code-block:: bash
$ sudo docker run --name console -t -i ubuntu bash