moby--moby/integration
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
..
build Builder: fix "COPY --from" to non-existing directory on Windows 2019-08-08 17:05:11 +02:00
config Add test for keeping same daemon ID on upgrade 2019-06-18 18:55:00 +00:00
container integration: have container.Create call compile 2019-06-14 18:26:12 +00:00
image Skip TestImagesFilterMultiReference on API < v1.40 2019-05-13 15:26:22 -07:00
internal Enable integrations API tests for Windows CI 2019-06-12 10:16:04 +02:00
network For ipvlan tests check that the ipvlan module is enabled (instead of just ensuring the kernel version is greater than 4.2) 2019-06-25 00:40:32 +02:00
plugin Use assert.NilError() instead of assert.Assert() 2019-01-21 13:16:02 +01:00
secret Fatalf -> Fatal 2019-01-27 00:43:24 +00:00
service Gracefully take care of the error case when a container 2019-06-12 20:00:51 +02:00
session Testing: create new daemon (only) if needed 2019-02-23 13:32:59 +01:00
system Revert "Remove Schema1 integration test suite" 2019-06-18 18:54:45 +00:00
testdata/https
volume Enable integrations API tests for Windows CI 2019-06-12 10:16:04 +02:00
doc.go