From 410719e6df618c4aea303cdea9667c3edba2f350 Mon Sep 17 00:00:00 2001 From: Adrien Folie Date: Tue, 15 Jul 2014 19:17:20 +0200 Subject: [PATCH] Add ENV variables support to WORKDIR build command Docker-DCO-1.1-Signed-off-by: Cristian Staretu (github: unclejack) Docker-DCO-1.1-Signed-off-by: Adrien Folie (github: folieadrien) Conflicts: builder/builder.go This file has been deleted. --- docs/sources/reference/builder.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/sources/reference/builder.md b/docs/sources/reference/builder.md index 93225994..2678a87a 100644 --- a/docs/sources/reference/builder.md +++ b/docs/sources/reference/builder.md @@ -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]