Pārlūkot izejas kodu

Windows: Clarify WORKDIR in docs

Signed-off-by: John Howard <jhoward@microsoft.com>
John Howard 8 gadi atpakaļ
vecāks
revīzija
e87c6dd3e4
1 mainītis faili ar 13 papildinājumiem un 0 dzēšanām
  1. 13 0
      docs/reference/builder.md

+ 13 - 0
docs/reference/builder.md

@@ -1269,6 +1269,19 @@ For example:
 The output of the final `pwd` command in this `Dockerfile` would be
 `/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 <name>[=<default value>]