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.
master
Adrien Folie 2014-07-15 19:17:20 +02:00 committed by Tibor Vass
parent 49323dfac9
commit 410719e6df
1 changed files with 11 additions and 1 deletions

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]