diff --git a/components/cli/docs/sources/reference/builder.md b/components/cli/docs/sources/reference/builder.md index 9322599414..2678a87a19 100644 --- a/components/cli/docs/sources/reference/builder.md +++ b/components/cli/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]