Merge pull request #8341 from unclejack/add_workdir_test

add test for workdir env vars and add docs
This commit is contained in:
Sven Dowideit
2014-10-07 14:27:32 +10:00
2 changed files with 35 additions and 1 deletions
+11 -1
View File
@@ -552,9 +552,19 @@ instruction. For example:
WORKDIR c
RUN pwd
The output of the final `pwd` command in this Dockerfile would be
The output of the final `pwd` command in this `Dockerfile` would be
`/a/b/c`.
The `WORKDIR` instruction can resolve environment variables previously set using
`ENV`. You can only use environment variables explicitly set in the `Dockerfile`.
For example:
ENV DIRPATH /path
WORKDIR $DIRPATH/$DIRNAME
The output of the final `pwd` command in this `Dockerfile` would be
`/path/$DIRNAME`
## ONBUILD
ONBUILD [INSTRUCTION]