Add ENV variables support to WORKDIR build command

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Docker-DCO-1.1-Signed-off-by: Adrien Folie <folie.adrien@gmail.com> (github: folieadrien)

Conflicts:
	builder/builder.go
		This file has been deleted.
This commit is contained in:
Adrien Folie
2014-10-01 17:34:36 +03:00
committed by unclejack
parent 3f2e4e94d7
commit 2c5b5cfc92
2 changed files with 35 additions and 1 deletions
+11 -1
View File
@@ -531,9 +531,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]