moby/builder/dockerfile
Sebastiaan van Stijn ff0a0e364b
Builder: fix "COPY --from" to non-existing directory on Windows
This fixes a regression introduced in 6d87f19142,
causing `COPY --from` to fail if the target directory does not exist:

```
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as s1
RUN echo "Hello World" > /hello

FROM mcr.microsoft.com/windows/servercore:ltsc2019
COPY --from=s1 /hello /hello/another/world
```

Would produce an error:

```
Step 4/4 : COPY --from=s1 /hello /hello/another/world
failed to copy files: mkdir \\?: The filename, directory name, or volume label syntax is incorrect.
```

The cause for this was that Go's `os.MkdirAll()` does not support/detect volume GUID paths
(`\\?\Volume{dae8d3ac-b9a1-11e9-88eb-e8554b2ba1db}\hello\another}`), and as a result
attempted to create the volume as a directory (`\\?`), causing it to fail.

This patch replaces `os.MkdirAll()` with our own `system.MkdirAll()` function, which
is capable of detecting GUID volumes.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5858a99267)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 17:05:11 +02:00
..
buildargs.go fix typos 2018-09-01 21:26:38 +08:00
buildargs_test.go Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
builder.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
builder_unix.go Add canonical import comment 2018-02-05 16:51:57 -05:00
builder_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
clientsession.go Switch from x/net/context -> context 2018-04-23 13:52:44 -07:00
containerbackend.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
copy.go Builder: fix "COPY --from" to non-existing directory on Windows 2019-08-08 17:05:11 +02:00
copy_test.go Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
copy_unix.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
copy_windows.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
dispatchers.go Merge pull request #38599 from thaJeztah/builder_fix_copy_permissions 2019-03-22 09:38:13 -07:00
dispatchers_test.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
dispatchers_unix.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
dispatchers_unix_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00
dispatchers_windows.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
dispatchers_windows_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00
evaluator.go vendor: use dockerfile parser from buildkit 2018-06-02 11:10:34 -07:00
evaluator_test.go LCOW: Log stderr on failures 2018-09-26 13:23:04 -07:00
imagecontext.go distribution: fix passing platform struct to puller 2018-06-27 14:59:31 -07:00
imageprobe.go Add canonical import comment 2018-02-05 16:51:57 -05:00
internals.go Merge pull request #38599 from thaJeztah/builder_fix_copy_permissions 2019-03-22 09:38:13 -07:00
internals_linux.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
internals_linux_test.go Add ADD/COPY --chown flag support to Windows 2018-08-13 21:59:11 -07:00
internals_test.go LCOW: Log stderr on failures 2018-09-26 13:23:04 -07:00
internals_windows.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
internals_windows_test.go Update tests to use gotest.tools 👼 2018-06-13 09:04:30 +02:00
metrics.go Add canonical import comment 2018-02-05 16:51:57 -05:00
mockbackend_test.go Windows: (WCOW) Generate OCI spec that remote runtime can escape 2019-03-12 18:41:55 -07:00
utils_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00