mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Add some documentation about relative WORKDIR values
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
This commit is contained in:
parent
c1f492755b
commit
69299f041f
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
------------
|
||||
|
|
Loading…
Reference in a new issue