Windows: Clarify WORKDIR in docs

Signed-off-by: John Howard <jhoward@microsoft.com>
master
John Howard 2016-10-28 10:28:38 -07:00 committed by Tibor Vass
parent 0e1a3f6bbb
commit 65bc3e9b3b
1 changed files with 13 additions and 0 deletions

View File

@ -1268,6 +1268,19 @@ For example:
The output of the final `pwd` command in this `Dockerfile` would be The output of the final `pwd` command in this `Dockerfile` would be
`/path/$DIRNAME` `/path/$DIRNAME`
On Windows, `WORKDIR` behaves differently depending on whether using Windows
Server containers or Hyper-V containers. For Hyper-V containers, the engine
is, for architectural reasons, unable to create the directory if it does not
previously exist. For Windows Server containers, the directory is created
if it does not exist. Hence, for consistency between Windows Server and
Hyper-V containers, it is strongly recommended to include an explict instruction
to create the directory in the Dockerfile. For example:
# escape=`
FROM microsoft/nanoserver
RUN mkdir c:\myapp
WORKDIR c:\myapp
## ARG ## ARG
ARG <name>[=<default value>] ARG <name>[=<default value>]