From 65bc3e9b3ba841e32df1e115b6414620c48d94cb Mon Sep 17 00:00:00 2001 From: John Howard Date: Fri, 28 Oct 2016 10:28:38 -0700 Subject: [PATCH] Windows: Clarify WORKDIR in docs Signed-off-by: John Howard --- docs/reference/builder.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index ffe010dd..3c7a2b8b 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -1268,6 +1268,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 [=]