Commit graph

36968 commits

Author SHA1 Message Date
Sebastiaan van Stijn
89e812a1e6
Makefile: Allow passing DOCKER_TEST_HOST and TESTDEBUG to container
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 968345bc5c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-19 18:54:47 +02:00
Sebastiaan van Stijn
e092ff3f74
Bump docker-py to 4.0.2, and run tests from upstream repository
This removes all the installation steps for docker-py from the
Dockerfile, and instead builds the upstream Dockerfile, and runs
docker-py tests in a container.

To test;

```
make test-docker-py

...

Removing bundles/

---> Making bundle: dynbinary (in bundles/dynbinary)
Building: bundles/dynbinary-daemon/dockerd-dev
Created binary: bundles/dynbinary-daemon/dockerd-dev

---> Making bundle: test-docker-py (in bundles/test-docker-py)
---> Making bundle: .integration-daemon-start (in bundles/test-docker-py)
Using test binary docker
Starting dockerd
INFO: Waiting for daemon to start...
.
INFO: Building docker-sdk-python3:3.7.0...
sha256:686428ae28479e9b5c8fdad1cadc9b7a39b462e66bd13a7e35bd79c6a152a402
INFO: Starting docker-py tests...
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-4.1.0, py-1.8.0, pluggy-0.9.0
rootdir: /src, inifile: pytest.ini
plugins: timeout-1.3.3, cov-2.6.1
collected 359 items

tests/integration/api_build_test.py .......s....
....
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7bfe48cc00)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-19 18:54:45 +02:00
Akihiro Suda
2b33fe3512
hack: remove integration-cli-on-swarm
integration-on-swarm had unnecessary complexity and was too hard to
maintain. Also, it didn't support the new non-CLI integration test suite.

I'm now doing some experiments out of the repo using Kubernetes:
https://github.com/AkihiroSuda/kube-moby-integration

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit e7fbe8e457)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-19 18:54:38 +02:00
Sebastiaan van Stijn
93c18c73a3
Merge pull request #327 from tonistiigi/double-unmount-1903
[19.03] builder-next: avoid double unmounting mountable
2019-08-16 20:30:09 +02:00
Tonis Tiigi
cad2cd71b7 builder-next: avoid double unmounting mountable
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 9ea2cf320a)
2019-08-15 22:45:08 -07:00
Sebastiaan van Stijn
96e086dc33
Merge pull request #326 from tonistiigi/update-buildkit-1903
[19.03] vendor: update buildkit to v0.6.1
2019-08-15 19:34:11 +02:00
Sebastiaan van Stijn
cddce2dfa7
Merge pull request #321 from dani-docker/19.03-bk-3945401
[19.03 backport] do not stop health check before sending signal
2019-08-15 16:16:58 +02:00
Tonis Tiigi
65f964aa6b vendor: update buildkit to v0.6.1
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit e59b26087f)
2019-08-14 18:56:38 -07:00
Dani Louca
8fca769bd5 Fixing integration test
Signed-off-by: Dani Louca <dani.louca@docker.com>
(cherry picked from commit 614daf1171)
Signed-off-by: Dani Louca <dani.louca@docker.com>
2019-08-14 17:07:40 -04:00
Sebastiaan van Stijn
ef5dd6e46d Skip TestHealthKillContainer on Windows
This test is failing on Windows currently:

```
11:59:47 --- FAIL: TestHealthKillContainer (8.12s)
11:59:47     health_test.go:57: assertion failed: error is not nil: Error response from daemon: Invalid signal: SIGUSR1
``

That test was added recently in https://github.com/moby/moby/pull/39454, but
rewritten in a commit in the same PR:
f8aef6a92f

In that rewrite, there were some changes:

- originally it was skipped on Windows, but the rewritten test doesn't have that skip:

    ```go
    testRequires(c, DaemonIsLinux) // busybox doesn't work on Windows
    ```

- the original test used `SIGINT`, but the new one uses `SIGUSR1`

Analysis:

- The Error bubbles up from: 8e610b2b55/pkg/signal/signal.go (L29-L44)
- Interestingly; `ContainerKill` should validate if a signal is valid for the given platform, but somehow we don't hit that part; f1b5612f20/daemon/kill.go (L40-L48)
- Windows only looks to support 2 signals currently 8e610b2b55/pkg/signal/signal_windows.go (L17-L26)
- Upstream Golang looks to define `SIGINT` as well; 77f9b2728e/src/runtime/defs_windows.go (L44)
- This looks like the current list of Signals upstream in Go; 3b58ed4ad3/windows/types_windows.go (L52-L67)

```go
const (
	// More invented values for signals
	SIGHUP  = Signal(0x1)
	SIGINT  = Signal(0x2)
	SIGQUIT = Signal(0x3)
	SIGILL  = Signal(0x4)
	SIGTRAP = Signal(0x5)
	SIGABRT = Signal(0x6)
	SIGBUS  = Signal(0x7)
	SIGFPE  = Signal(0x8)
	SIGKILL = Signal(0x9)
	SIGSEGV = Signal(0xb)
	SIGPIPE = Signal(0xd)
	SIGALRM = Signal(0xe)
	SIGTERM = Signal(0xf)
)
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit eeaa0b30d4)
Signed-off-by: Dani Louca <dani.louca@docker.com>
2019-08-14 17:07:39 -04:00
Brian Goff
8533594ad6 Move kill health test to integration
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit f8aef6a92f)
Signed-off-by: Dani Louca <dani.louca@docker.com>
2019-08-14 17:07:39 -04:00
Ruilin Li
32802bc7d9 do not stop health check before sending signal
Docker daemon always stops healthcheck before sending signal to a
container now. However, when we use "docker kill" to send signals
other than SIGTERM or SIGKILL to a container, such as SIGINT,
daemon still stops container health check though container process
handles the signal normally and continues to work.

Signed-off-by: Ruilin Li <liruilin4@huawei.com>
(cherry picked from commit da574f9343)
Signed-off-by: Dani Louca <dani.louca@docker.com>
2019-08-14 17:07:39 -04:00
Andrew Hsu
4bed01298c
Merge pull request #322 from thaJeztah/19.03_backport_bump_golang_1.12.8
[19.03 backport] Bump golang 1.12.8 (CVE-2019-9512, CVE-2019-9514)
2019-08-14 11:55:08 -07:00
Andrew Hsu
56ca630f27
Merge pull request #325 from thaJeztah/19.03_backport_harden_TestClientWithRequestTimeout
[19.03 backport] Harden TestClientWithRequestTimeout
2019-08-14 08:45:49 -07:00
Sebastiaan van Stijn
a02539b3e8
Harden TestClientWithRequestTimeout
DeadlineExceeded now implements a TimeOut() function,
since dc4427f372

Check for this interface, to prevent possibly incorrect failures;

```
00:16:41 --- FAIL: TestClientWithRequestTimeout (0.00s)
00:16:41     client_test.go:259: assertion failed:
00:16:41         --- context.DeadlineExceeded
00:16:41         +++ err
00:16:41         :
00:16:41         	-: context.deadlineExceededError{}
00:16:41         	+: &net.OpError{Op: "dial", Net: "tcp", Addr: s"127.0.0.1:49294", Err: &poll.TimeoutError{}}
00:16:41
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit c7816c5323)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-14 15:21:34 +02:00
Sebastiaan van Stijn
0dc7bdc325
Adjust tests for changes in Go 1.12.8 / 1.11.13
```
00:38:11 === Failed
00:38:11 === FAIL: opts TestParseDockerDaemonHost (0.00s)
00:38:11     hosts_test.go:87: tcp tcp:a.b.c.d address expected error "Invalid bind address format: tcp:a.b.c.d" return, got "parse tcp://tcp:a.b.c.d: invalid port \":a.b.c.d\" after host" and addr
00:38:11     hosts_test.go:87: tcp tcp:a.b.c.d/path address expected error "Invalid bind address format: tcp:a.b.c.d/path" return, got "parse tcp://tcp:a.b.c.d/path: invalid port \":a.b.c.d\" after host" and addr
00:38:11
00:38:11 === FAIL: opts TestParseTCP (0.00s)
00:38:11     hosts_test.go:129: tcp tcp:a.b.c.d address expected error Invalid bind address format: tcp:a.b.c.d return, got parse tcp://tcp:a.b.c.d: invalid port ":a.b.c.d" after host and addr
00:38:11     hosts_test.go:129: tcp tcp:a.b.c.d/path address expected error Invalid bind address format: tcp:a.b.c.d/path return, got parse tcp://tcp:a.b.c.d/path: invalid port ":a.b.c.d" after host and addr
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 683766613a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-14 02:52:42 +02:00
Sebastiaan van Stijn
b61ee6e4af
Bump golang 1.12.8 (CVE-2019-9512, CVE-2019-9514)
go1.12.8 (released 2019/08/13) includes security fixes to the net/http and net/url packages.
See the Go 1.12.8 milestone on our issue tracker for details:

https://github.com/golang/go/issues?q=milestone%3AGo1.12.8

- net/http: Denial of Service vulnerabilities in the HTTP/2 implementation
  net/http and golang.org/x/net/http2 servers that accept direct connections from untrusted
  clients could be remotely made to allocate an unlimited amount of memory, until the program
  crashes. Servers will now close connections if the send queue accumulates too many control
  messages.
  The issues are CVE-2019-9512 and CVE-2019-9514, and Go issue golang.org/issue/33606.
  Thanks to Jonathan Looney from Netflix for discovering and reporting these issues.
  This is also fixed in version v0.0.0-20190813141303-74dc4d7220e7 of golang.org/x/net/http2.
  net/url: parsing validation issue
- url.Parse would accept URLs with malformed hosts, such that the Host field could have arbitrary
  suffixes that would appear in neither Hostname() nor Port(), allowing authorization bypasses
  in certain applications. Note that URLs with invalid, not numeric ports will now return an error
  from url.Parse.
  The issue is CVE-2019-14809 and Go issue golang.org/issue/29098.
  Thanks to Julian Hector and Nikolai Krein from Cure53, and Adi Cohen (adico.me) for discovering
  and reporting this issue.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 73b0e4c589)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-14 02:37:04 +02:00
Andrew Hsu
56784591bf
Merge pull request #319 from kolyshkin/19.03-journald
[19.03] backport journald reading fixes (ENGCORE-941)
2019-08-13 11:48:05 -07:00
Sebastiaan van Stijn
6eeb9ec3d6
Merge pull request #291 from thaJeztah/19.03_backport_fix_more_grpc_sizes
[19.03 backport] Fix more grpc list message sizes
2019-08-10 20:31:25 +02:00
Kir Kolyshkin
dd7ef76474 journald/read: fix/unify errors
1. Use "in-place" variables for if statements to limit their scope to
   the respectful `if` block.

2. Report the error returned from sd_journal_* by using CErr().

3. Use errors.New() instead of fmt.Errorf().

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
 (cherry picked from commit 20a0e58a79)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:50:39 -07:00
Kir Kolyshkin
0375566412 journald: fix for --tail 0
From the first glance, `docker logs --tail 0` does not make sense,
as it is supposed to produce no output, but `tail -n 0` from GNU
coreutils is working like that, plus there is even a test case
(`TestLogsTail` in integration-cli/docker_cli_logs_test.go).

Now, something like `docker logs --follow --tail 0` makes total
sense, so let's make it work.

(NOTE if --tail is not used, config.Tail is set to -1)

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit dd4bfe30a8)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:43 -07:00
Kir Kolyshkin
3678438dd8 journald/read: avoid piling up open files
If we take a long time to process log messages, and during that time
journal file rotation occurs, the journald client library will keep
those rotated files open until sd_journal_process() is called.

By periodically calling sd_journal_process() during the processing
loop we shrink the window of time a client instance has open file
descriptors for rotated (deleted) journal files.

This code is modelled after that of journalctl [1]; the above explanation
as well as the value of 1024 is taken from there.

[v2: fix CErr() argument]

[1] https://github.com/systemd/systemd/blob/dc16327c48d/src/journal/journalctl.c#L2676
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit b73fb8fd5d)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:38 -07:00
Kir Kolyshkin
1cc7b3881d journald/read: simplify/fix followJournal()
TL;DR: simplify the code, fix --follow hanging indefinitely

Do the following to simplify the followJournal() code:

1. Use Go-native select instead of C-native polling.

2. Use Watch{Producer,Consumer}Gone(), eliminating the need
to have journald.closed variable, and an extra goroutine.

3. Use sd_journal_wait(). In the words of its own man page:

> A synchronous alternative for using sd_journal_get_fd(),
> sd_journal_get_events(), sd_journal_get_timeout() and
> sd_journal_process() is sd_journal_wait().

Unfortunately, the logic is still not as simple as it
could be; the reason being, once the container has exited,
journald might still be writing some logs from its internal
buffers onto journal file(s), and there is no way to
figure out whether it's done so we are guaranteed to
read all of it back. This bug can be reproduced with
something like

> $ ID=$(docker run -d busybox seq 1 150000); docker logs --follow $ID
> ...
> 128123
> $

(The last expected output line should be `150000`).

To avoid exiting from followJournal() early, add the
following logic: once the container is gone, keep trying
to drain the journal until there's no new data for at
least `waitTimeout` time period.

Should fix https://github.com/docker/for-linux/issues/575

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit f091febc94)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:34 -07:00
Kir Kolyshkin
03b1b078f9 Call sd_journal_get_fd() earlier, only if needed
1. The journald client library initializes inotify watch(es)
during the first call to sd_journal_get_fd(), and it make sense
to open it earlier in order to not lose any journal file rotation
events.

2. It only makes sense to call this if we're going to use it
later on -- so add a check for config.Follow.

3. Remove the redundant call to sd_journal_get_fd().

NOTE that any subsequent calls to sd_journal_get_fd() return
the same file descriptor, so there's no real need to save it
for later use in wait_for_data_cancelable().

Based on earlier patch by Nalin Dahyabhai <nalin@redhat.com>.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 981c01665b)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:34 -07:00
Kir Kolyshkin
5067389c36 journald/read: avoid being blocked on send
In case the LogConsumer is gone, the code that sends the message can
stuck forever. Wrap the code in select case, as all other loggers do.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 79039720c8)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:29 -07:00
Kir Kolyshkin
6d98ef8c69 journald/read: simplify walking backwards
In case Tail=N parameter is requested, we need to show N lines.
It does not make sense to walk backwards one by one if we can
do it at once. Now, if Since=T is also provided, make sure we
haven't jumped too far (before T), and if we did, move forward.

The primary motivation for this was to make the code simpler.

This also fixes a tiny bug in the "since" implementation.

Before this commit:
> $ docker logs -t --tail=6000 --since="2019-03-10T03:54:25.00" $ID | head
> 2019-03-10T03:54:24.999821000Z 95981

After:
> $ docker logs -t --tail=6000 --since="2019-03-10T03:54:25.00" $ID | head
> 2019-03-10T03:54:25.000013000Z 95982

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit ff3cd167ea)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:23 -07:00
Kir Kolyshkin
d5088c1488 journald/read: simplify code
Minor code simplification.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit e8f6166791)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:23 -07:00
Nalin Dahyabhai
df3689f8d0 Small journal cleanup
Clean up a deferred function call in the journal reading logic.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
(cherry picked from commit 1ada3e85bf)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2019-08-09 16:47:23 -07:00
Drew Erny
3fd0be03f0
Fix more grpc list message sizes
There are a few more places, apparently, that List operations against
Swarm exist, besides just in the List methods. This increases the max
received message size in those places.

Signed-off-by: Drew Erny <drew.erny@docker.com>
(cherry picked from commit a84a78e976)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-09 11:23:25 +02:00
Andrew Hsu
37d9901e0f
Merge pull request #306 from thaJeztah/19.03_bump_swarmkit
[19.03] bump swarmkit to 4fb9e961aba635f0240a140e89ece6d6c2082585 (bump_v19.03)
2019-08-08 22:52:52 -07:00
Andrew Hsu
29fe4e58c6
Merge pull request #317 from thaJeztah/19.03_backport_fix_39623
[19.03 backport] Fix regression in handling of NotFound err during startup ENGCORE-929
2019-08-08 20:39:02 -07:00
Deep Debroy
685565ad18
Fix regression in handling of NotFound err during startup
Signed-off-by: Deep Debroy <ddebroy@docker.com>
(cherry picked from commit 4d5b6260bc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-09 02:09:13 +02:00
Andrew Hsu
305b2416ea
Merge pull request #316 from thaJeztah/19.03_backport_buildkit_userns_remap_take2
[19.03 backport] builder-next: userns remap support and honor daemon's DNS config
2019-08-08 13:35:34 -07:00
Andrew Hsu
f5b64c3ffe
Merge pull request #294 from thaJeztah/19.03_backport_chroot_unsupported
[19.03 backport] Add realChroot for non linux/windows
2019-08-08 13:02:45 -07:00
Andrew Hsu
9f9dab03c1
Merge pull request #314 from thaJeztah/19.03_backport_revendor_go_winio
[19.03 backport] Update Microsoft/go-winio v0.4.14
2019-08-08 11:03:17 -07:00
Andrew Hsu
c7139be62b
Merge pull request #315 from thaJeztah/19.03_backport_fix_copy_on_windows
[19.03 backport] Builder: fix "COPY --from" to non-existing directory on Windows [ENGCORE-935]
2019-08-08 10:27:44 -07:00
Tonis Tiigi
b0ef7422b0
vendor: update buildkit to f5a55a95
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit c60e53a274)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 19:01:44 +02:00
Sebastiaan van Stijn
1fbed3ffc9
bump vndr to f5ab8fc5f, and revendor
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0a3c9b935c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 18:49:07 +02:00
Tibor Vass
dd85af0e12
build: buildkit now honors daemon's DNS config
Signed-off-by: Tibor Vass <tibor@docker.com>
(cherry picked from commit a1cdd4bfcc)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 18:43:00 +02:00
Tonis Tiigi
3bbf7b0d4d
builder-next: reset identitymapping if empty
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 0bdcc60c4c)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 18:42:53 +02:00
Tonis Tiigi
bc9183ba0e
vendor: update buildkit to c2427506
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 5c484890e0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 18:42:44 +02:00
Tonis Tiigi
47517880ec
builder-next: userns remap support
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
(cherry picked from commit 07b3aac902)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 18:42:42 +02:00
Sebastiaan van Stijn
7b0cf8b16d
Revert "vendor: update buildkit to f5a55a95"
This reverts commit eaa83640fa.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 18:32:27 +02:00
Brian Goff
47a7f762d3
Add realChroot for non linux/windows
3029e765e2 broke compilation on
non-Linux/Windows systems.
This change fixes that.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 34d5b8867f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 18:15:26 +02:00
Justin Terry (VM)
8ba31dccd1
Update Microsoft/go-winio v0.4.14
Signed-off-by: Justin Terry (VM) <juterry@microsoft.com>
(cherry picked from commit 35fe16b7eb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 17:10:55 +02:00
Kevin Parsons
80376f9e13
Revendor go-winio
This is needed to provide fixes for ETW on ARM. The updated ETW package will
no-op on ARM, rather than crashing. Further changes are needed to Go itself to
allow ETW on ARM to work properly.

Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
(cherry picked from commit e1f0f77bf4)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 17:10:52 +02:00
Sebastiaan van Stijn
ee64eae903
bump swarmkit to 4fb9e961aba635f0240a140e89ece6d6c2082585 (bump_v19.03 branch)
full diff: 961ec3a56b...4fb9e961ab

included:

- docker/swarmkit#2873 [19.03 backport] Only update non-terminal tasks on node removal
  - backport of docker/swarmkit#2867 Only update non-terminal tasks on node removal

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 17:08:57 +02:00
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
Sebastiaan van Stijn
791aa3c338
make.ps1: Run-IntegrationTests(): set working directory for test suite
This function changed to the correct working directory before starting the tests
(which is the same as on Linux), however the `ProcessStartInfo` process does
not inherit this working directory, which caused Windows tests to be running
with a different working directory as Linux (causing files used in tests to not
be found).

From the documentation; https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.processstartinfo.workingdirectory?view=netframework-4.8

> When `UseShellExecute` is `true`, the fully qualified name of the directory that contains
> the process to be started. When the `UseShellExecute` property is `false`, the working
> directory for the process to be started. The default is an empty string (`""`).

This patch sets the `ProcessStartInfo.WorkingDirectory` to the correct working
directory before starting the process.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6ae46aeabf)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-08-08 17:05:08 +02:00
Sebastiaan van Stijn
6e9aba883c
Merge pull request #313 from thaJeztah/19.03_backport_its_a_stretch_but_it_was_busted
[19.03 backport] use GO_VERSION and pin to debian stretch
2019-08-08 17:04:32 +02:00