Docker-DCO-1.1-Signed-off-by: Sven Dowideit <SvenDowideit@fosiki.com> (github: SvenDowideit)
| ... | ... |
@@ -147,17 +147,23 @@ the generated images. |
| 147 | 147 |
3.3 RUN |
| 148 | 148 |
------- |
| 149 | 149 |
|
| 150 |
- ``RUN <command>`` |
|
| 150 |
+RUN has 2 forms: |
|
| 151 | 151 |
|
| 152 |
-The ``RUN`` instruction will execute any commands on the current image |
|
| 153 |
-and commit the results. The resulting committed image will be used for |
|
| 154 |
-the next step in the Dockerfile. |
|
| 152 |
+* ``RUN <command>`` (the command is run in a shell - ``/bin/sh -c``) |
|
| 153 |
+* ``RUN ["executable", "param1", "param2"]`` (*exec* form) |
|
| 154 |
+ |
|
| 155 |
+The ``RUN`` instruction will execute any commands in a new layer on top |
|
| 156 |
+of the current image and commit the results. The resulting committed image |
|
| 157 |
+will be used for the next step in the Dockerfile. |
|
| 155 | 158 |
|
| 156 | 159 |
Layering ``RUN`` instructions and generating commits conforms to the |
| 157 | 160 |
core concepts of Docker where commits are cheap and containers can be |
| 158 | 161 |
created from any point in an image's history, much like source |
| 159 | 162 |
control. |
| 160 | 163 |
|
| 164 |
+The *exec* form makes it possible to avoid shell string munging, and to ``RUN`` |
|
| 165 |
+commands using a base image that does not contain ``/bin/sh``. |
|
| 166 |
+ |
|
| 161 | 167 |
Known Issues (RUN) |
| 162 | 168 |
.................. |
| 163 | 169 |
|