Add some documentation about relative WORKDIR values

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: dfd2d9f1ea
Component: cli
This commit is contained in:
Tianon Gravi
2017-06-02 00:06:23 +00:00
committed by Tibor Vass
parent afcb2e8d58
commit 3288817f4c
@@ -407,7 +407,16 @@ the image.
The ``WORKDIR`` instruction sets the working directory for the ``RUN``, ``CMD`` and
``ENTRYPOINT`` Dockerfile commands that follow it.
It can be used multiple times in the one Dockerfile.
It can be used multiple times in the one Dockerfile. If a relative path is
provided, it will be relative to the path of the previous ``WORKDIR``
instruction. For example:
WORKDIR /a
WORKDIR b
WORKDIR c
RUN pwd
The output of the final ``pwd`` command in this Dockerfile would be ``/a/b/c``.
3.11 ONBUILD
------------