8000 Distinguish ENV from setting environment inline by kojiromike · Pull Request #10273 · moby/moby · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Distinguish ENV from setting environment inline #10273

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/sources/reference/builder.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ was no formal definition on as to which instructions handled environment
replacement at the time. After 1.3 this behavior will be preserved and
canonical.

Environment variables (declared with the `ENV` statement) can also be used in
Environment variables (declared with [the `ENV` statement](#env)) can also be used in
certain instructions as variables to be interpreted by the `Dockerfile`. Escapes
are also handled for including variable-like syntax into a statement literally.

Expand Down Expand Up @@ -349,9 +349,8 @@ accessible from the host by default. To expose ports to the host, at runtime,
ENV <key>=<value> ...

The `ENV` instruction sets the environment variable `<key>` to the value
`<value>`. This value will be passed to all future
`RUN`, `ENTRYPOINT`, and `CMD` instructions. This is
functionally equivalent to prefixing the command with `<key>=<value>`
`<value>`. This value will be in the environment of all "descendent" `Dockerfile`
commands and can be [replaced inline](#environment-replacement) in many as well.

The `ENV` instruction has two forms. The first form, `ENV <key> <value>`,
will set a single variable to a value. The entire string after the first
Expand Down Expand Up @@ -382,9 +381,10 @@ from the resulting image. You can view the values using `docker inspect`, and
change them using `docker run --env <key>=<value>`.

> **Note**:
> One example where this can cause unexpected consequences, is setting
> `ENV DEBIAN_FRONTEND noninteractive`. Which will persist when the container
> is run interactively; for example: `docker run -t -i image bash`
> Environment persistence can cause unexpected effects. For example,
> setting `ENV DEBIAN_FRONTEND noninteractive` may confuse apt-get
> users on a Debian-based image. To set a value for a single command, use
> `RUN <key>=<value> <command>`.

## ADD

Expand Down
0