Improve documentation on the -e flag to the 'run' cli command.
| ... | ... |
@@ -1408,13 +1408,17 @@ The following environment variables are set for Linux containers: |
| 1408 | 1408 |
|
| 1409 | 1409 |
Additionally, the operator can **set any environment variable** in the |
| 1410 | 1410 |
container by using one or more `-e` flags, even overriding those mentioned |
| 1411 |
-above, or already defined by the developer with a Dockerfile `ENV`: |
|
| 1411 |
+above, or already defined by the developer with a Dockerfile `ENV`. If the |
|
| 1412 |
+operator names an environment variable without specifying a value, then the |
|
| 1413 |
+current value of the named variable is propagated into the container's environment: |
|
| 1412 | 1414 |
|
| 1413 | 1415 |
```bash |
| 1414 |
-$ docker run -e "deep=purple" --rm alpine env |
|
| 1416 |
+$ export today=Wednesday |
|
| 1417 |
+$ docker run -e "deep=purple" -e today --rm alpine env |
|
| 1415 | 1418 |
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| 1416 | 1419 |
HOSTNAME=d2219b854598 |
| 1417 | 1420 |
deep=purple |
| 1421 |
+today=Wednesday |
|
| 1418 | 1422 |
HOME=/root |
| 1419 | 1423 |
``` |
| 1420 | 1424 |
|