mirror of https://github.com/docker/docs.git
Merge pull request #16253 from AmeBel/update-documentation-on-run
add a documentation note on backslash usage in shell form of RUN
This commit is contained in:
commit
621143a641
|
@ -295,6 +295,17 @@ any point in an image's history, much like source control.
|
||||||
The *exec* form makes it possible to avoid shell string munging, and to `RUN`
|
The *exec* form makes it possible to avoid shell string munging, and to `RUN`
|
||||||
commands using a base image that does not contain `/bin/sh`.
|
commands using a base image that does not contain `/bin/sh`.
|
||||||
|
|
||||||
|
In the *shell* form you can use a `\` (backslash) to continue a single
|
||||||
|
RUN instruction onto the next line. For example, consider these two lines:
|
||||||
|
```
|
||||||
|
RUN /bin/bash -c 'source $HOME/.bashrc ;\
|
||||||
|
echo $HOME'
|
||||||
|
```
|
||||||
|
Together they are equivalent to this single line:
|
||||||
|
```
|
||||||
|
RUN /bin/bash -c 'source $HOME/.bashrc ; echo $HOME'
|
||||||
|
```
|
||||||
|
|
||||||
> **Note**:
|
> **Note**:
|
||||||
> To use a different shell, other than '/bin/sh', use the *exec* form
|
> To use a different shell, other than '/bin/sh', use the *exec* form
|
||||||
> passing in the desired shell. For example,
|
> passing in the desired shell. For example,
|
||||||
|
|
Loading…
Reference in New Issue