1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Minor edits to Environment variables section

* Clarify the list of supported instructions.
* Clarify behavior of ONBUILD, based on comments by @SvenDowideit, @theJeztah in PR #14735.
* Reorder list of instructions in alphabetical order.

Signed-off-by: Charles Chan <charleswhchan@users.noreply.github.com>
This commit is contained in:
Charles Chan 2015-07-18 21:09:48 -07:00
parent a89370039a
commit 42263dafcf

View file

@ -152,18 +152,24 @@ Example (parsed representation is displayed after the `#`):
ADD . $foo # ADD . /bar
COPY \$foo /quux # COPY $foo /quux
The instructions that handle environment variables in the `Dockerfile` are:
Environment variables are supported by the following list of instructions in
the `Dockerfile`:
* `ENV`
* `ADD`
* `COPY`
* `WORKDIR`
* `ENV`
* `EXPOSE`
* `VOLUME`
* `USER`
* `WORKDIR`
* `VOLUME`
`ONBUILD` instructions are **NOT** supported for environment replacement, even
the instructions above.
as well as:
* `ONBUILD` (when combined with one of the supported instructions above)
> **Note**:
> prior to 1.4, `ONBUILD` instructions did **NOT** support environment
> variable, even when combined with any of the instructions listed above.
Environment variable substitution will use the same value for each variable
throughout the entire command. In other words, in this example: