mirror of https://github.com/docker/docs.git
Fix error for env variables example in docker reference - 2
The reason why the issue occurs is because sh parses the first argument after -c as the whole script to execute.
Everything after isn't executed as one might expect.
When working on the 'fix' I found out the same fix is also done in commit 2af7c5cfe2
, except only for one occurrence.
Signed-off-by: Serhat Gülçiçek <serhat+signoff@equil.nl>
(cherry picked from commit 7a30fa7af6f0bb3850ce6167850642420b4c0633)
This commit is contained in:
parent
eaf5b17592
commit
f4de46d2ac
|
@ -606,7 +606,7 @@ instruction as well.
|
||||||
> This means that normal shell processing does not happen. For example,
|
> This means that normal shell processing does not happen. For example,
|
||||||
> `CMD [ "echo", "$HOME" ]` will not do variable substitution on `$HOME`.
|
> `CMD [ "echo", "$HOME" ]` will not do variable substitution on `$HOME`.
|
||||||
> If you want shell processing then either use the *shell* form or execute
|
> If you want shell processing then either use the *shell* form or execute
|
||||||
> a shell directly, for example: `CMD [ "sh", "-c", "echo", "$HOME" ]`.
|
> a shell directly, for example: `CMD [ "sh", "-c", "echo $HOME" ]`.
|
||||||
|
|
||||||
When used in the shell or exec formats, the `CMD` instruction sets the command
|
When used in the shell or exec formats, the `CMD` instruction sets the command
|
||||||
to be executed when running the image.
|
to be executed when running the image.
|
||||||
|
@ -1074,7 +1074,7 @@ sys 0m 0.03s
|
||||||
> This means that normal shell processing does not happen. For example,
|
> This means that normal shell processing does not happen. For example,
|
||||||
> `ENTRYPOINT [ "echo", "$HOME" ]` will not do variable substitution on `$HOME`.
|
> `ENTRYPOINT [ "echo", "$HOME" ]` will not do variable substitution on `$HOME`.
|
||||||
> If you want shell processing then either use the *shell* form or execute
|
> If you want shell processing then either use the *shell* form or execute
|
||||||
> a shell directly, for example: `ENTRYPOINT [ "sh", "-c", "echo", "$HOME" ]`.
|
> a shell directly, for example: `ENTRYPOINT [ "sh", "-c", "echo $HOME" ]`.
|
||||||
> Variables that are defined in the `Dockerfile`using `ENV`, will be substituted by
|
> Variables that are defined in the `Dockerfile`using `ENV`, will be substituted by
|
||||||
> the `Dockerfile` parser.
|
> the `Dockerfile` parser.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue