Commit Graph

32844 Commits

Author SHA1 Message Date
985dd23e4a Enable CRIU on non-amd64 architectures
Since the recent release of CRIU has already supported other
arches such as AArch64, ppc64le, and s390x, so we can enable
it now.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 7fd54a7a48f9f1bb2b28144e38c886d1fe813a04
Component: engine
2018-03-23 05:52:35 +00:00
5656978b1e Merge pull request #36662 from adshmh/use-unique-resource-names-for-container-inspect-ps-stop-integration-tests
Use unique names for test resources of container/inspect, container/ps, container/stop tests
Upstream-commit: 57c504799d979caa706142e6f5dc4be4a5b1e3e2
Component: engine
2018-03-23 12:16:53 +09:00
f358bd4b47 daemon: use context error rather than inventing new one
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: d84da75f01e0a0d20fbddb8b051a325e3b21eded
Component: engine
2018-03-22 09:38:59 -07:00
10376dc96a Merge pull request #36663 from tonistiigi/hijackconn-fix
client: fix hijackedconn reading from buffer
Upstream-commit: 69091990c72f3a3a6143fe6417a769e7a1a1ff1a
Component: engine
2018-03-22 17:10:06 +01:00
1f699969f9 Merge pull request #36587 from justincormack/unpriv-caps
If container will run as non root user, drop permitted, effective caps early
Upstream-commit: b67c1e078c7eeb20199dce301e95fa8999c98109
Component: engine
2018-03-22 14:51:29 +01:00
34dd223936 Merge pull request #36647 from adshmh/use-unique-names-for-container-nat-test-containers
use unique names for test containers of container/nat integration tests 
Upstream-commit: 00c59ed77e186b6f9056bb8e0a2700767b4be383
Component: engine
2018-03-22 14:03:36 +01:00
3db81e37ca Merge pull request #36172 from kolyshkin/systemd-memlimit
Test for systemd cgroupdriver memory setting
Upstream-commit: e2bede01e4a6a6f84e33e2a6debf2cfed5938828
Component: engine
2018-03-22 13:36:43 +01:00
2748b681fe Merge pull request #36653 from thaJeztah/refactor-windows-service-code
Split daemon service code to _windows file
Upstream-commit: 3baa5889592894a9d39938aa8fdf08e879cb8a25
Component: engine
2018-03-22 21:14:17 +09:00
4ad54eacb8 client: fix hijackedconn reading from buffer
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: f094a05e260d8748f0fd2018a8a908b4189e454d
Component: engine
2018-03-21 15:29:44 -07:00
809b43730d use unique names for resources used by integration tests container/inspect_test, container/ps_test, container/stop_test
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: 78e4be91332e2237c0fa14eb3ba0fb5b915c3256
Component: engine
2018-03-21 17:47:49 -04:00
f95a3e7bb8 Fix for Flaky test TestServiceWithPredefinedNetwork
TestServiceWithPredefinedNetwork test case was failing
	at times. To fix the issue, added new API to check
	for services after we clean up all services. Tested
	multiple times and this sould fix flaky issue.

Signed-off-by: selansen <elango.siva@docker.com>
Upstream-commit: dabffd806c98ab13dbc25e57bee21c5291b9a50c
Component: engine
2018-03-21 11:49:23 -04:00
bc6cc53700 Split daemon service code to _windows file
This moves some of the code that was conditionally
executed on Windows to a separate, windows-only file.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: cd3e84c6b38e74d03ab31db804bc9b49dcab8243
Component: engine
2018-03-21 12:57:53 +01:00
5509cd2416 Merge pull request #36594 from vdemeester/e2e-more-run
integration/*: make e2e run without failure
Upstream-commit: 4460472f4ee419794bb416d131c92dc296b5c625
Component: engine
2018-03-21 08:54:39 +01:00
81ade09fe5 Merge pull request #36515 from vdemeester/migrate-trusted-suite
Remove DockerTrustSuite to docker/cli e2e tests
Upstream-commit: 8aa694c91ac727351ebb1deaacad62149e984fd6
Component: engine
2018-03-21 08:50:59 +01:00
3d5d533860 container/nat integration tests use unique names for test containers
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: b4d1547af6b91baa2ffcb8a391c35d9bc5cdc48f
Component: engine
2018-03-20 17:11:03 -04:00
1c15bdeddb Merge pull request #36466 from thaJeztah/fix-exec-apparmor
Fix AppArmor not being applied to Exec processes
Upstream-commit: 0c1006f1abc1af7aa6b9847754370d054dfa6c68
Component: engine
2018-03-19 15:12:41 -07:00
3d783d5dbf If container will run as non root user, drop permitted, effective caps early
As soon as the initial executable in the container is executed as a non root user,
permitted and effective capabilities are dropped. Drop them earlier than this, so
that they are dropped before executing the file. The main effect of this is that
if `CAP_DAC_OVERRIDE` is set (the default) the user will not be able to execute
files they do not have permission to execute, which previously they could.

The old behaviour was somewhat surprising and the new one is definitely correct,
but it is not in any meaningful way exploitable, and I do not think it is
necessary to backport this fix. It is unlikely to have any negative effects as
almost all executables have world execute permission anyway.

Use the bounding set not the effective set as the canonical set of capabilities, as
effective will now vary.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 15ff09395c001bcb0f284461abbc404a1d8bab4d
Component: engine
2018-03-19 14:45:27 -07:00
24ded82e63 Merge pull request #36633 from adshmh/add-missing-setup-test-call-to-TestNetworkLoopbackNat
Add the missing call to setupTest to TestNetworkLoopbackNat test
Upstream-commit: 60e2dc26864370a315dbbb8e3325fe5cc78ba5d5
Component: engine
2018-03-19 20:45:22 +01:00
c9d18328ef Merge pull request #29932 from miaoyq/container-log-add-archive
add support for compressibility of log file
Upstream-commit: c4e93da8a6fcd206e3fbfb07b821b5743f90f437
Component: engine
2018-03-19 15:20:17 -04:00
6bad7e6180 Test for systemd cgroupdriver memory setting
This is a test case for issue https://github.com/moby/moby/issues/35123,
making sure we can set container's memory limit when using
`native.cgroupdriver=systemd`.

[v2: skip if no systemd present]
[v3: add --iptables=false to avoid flaky tests with t.Parallel()]
[v4: rebase after PR#36507 merge]

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 4ca5c5361059e29ed31074ca5b96f8b2030b5f99
Component: engine
2018-03-19 10:33:03 -07:00
ef1461a872 Add the missing call to setupTest to TestNetworkLoopbackNat test function, to avoid leaving behind test containers
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
Upstream-commit: a0052b8f190f38bcdd24e4bf794c3ad6d2fd1b41
Component: engine
2018-03-19 10:56:13 -04:00
27bd98bb9a Merge pull request #36617 from Microsoft/jjh/kernel-registry
Windows: Move kernel_windows to use golang registry functions
Upstream-commit: 7270b01e5dd1fca3fd7fed0d6fb9d2769ec5f4ba
Component: engine
2018-03-19 11:47:17 +01:00
d36e75fc44 integration/*: make e2e run without failure
… mainly by skipping if daemon is remote.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 6016e79d2552b21643f4bfd093ce76d8ef956d79
Component: engine
2018-03-19 09:47:17 +01:00
aac739f262 Migrate DockerTrustSuite to docker/cli e2e tests
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5433ceb12ead305d8c85e8e27c4b4d842ef88ae0
Component: engine
2018-03-19 09:26:35 +01:00
559e0317a4 Merge pull request #36507 from dnephin/use-gty-assert
Replace testify/assert with gotestyourself/assert
Upstream-commit: 7bda5be956eb1123d597b3c497d938c4d6df3327
Component: engine
2018-03-19 09:08:06 +01:00
5c48fab022 Merge pull request #36609 from thaJeztah/fix-stats-loop
Fix stats collector spinning CPU if no stats are collected
Upstream-commit: 72ba7f593fa4dbb628cf5ee83cd7daf955934cf5
Component: engine
2018-03-16 10:35:10 -07:00
ad67257ea2 Windows: Move kernel_windows to use golang registry functions
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 29f93c4bc7bb2fbbaaa8c3f809e858ce1f12a0f2
Component: engine
2018-03-16 09:47:45 -07:00
047c647903 Update testing doc
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 58de6277821698a2f97d1a0c83664ab34ff2e8d8
Component: engine
2018-03-16 11:03:47 -04:00
0fdeea8152 Cleanup pkg/jsonmessage progress tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 7d8815ea705e85a73248b5d9e468f9dc65277bb8
Component: engine
2018-03-16 11:03:47 -04:00
0331f04e35 Post migration assertion fixes
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: c9e52bd0da0461e605a3678b85702f83081504a7
Component: engine
2018-03-16 11:03:46 -04:00
60daf5fa97 Automated migration using
gty-migrate-from-testify --ignore-build-tags

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 6be0f709830113966f295401327b027ec2f0bbca
Component: engine
2018-03-16 11:03:43 -04:00
1c9c9f9e72 Cleanup some assertions
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: ef01dea8935932486f03a37069720987e805dce6
Component: engine
2018-03-16 10:54:54 -04:00
59efca5b6e Update vendor
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 073963e3b770efbdf8bd4b4f92d46b2c62eaf434
Component: engine
2018-03-16 10:54:54 -04:00
8366463034 Merge pull request #36606 from kolyshkin/t-36561
integration/TestExportContainerAfterDaemonRestart: add
Upstream-commit: 823de22db611d5079fcc92788a89897daba6f389
Component: engine
2018-03-16 12:07:46 +01:00
da9945b5a8 Merge pull request #36584 from cpuguy83/volume_store_tests
Add some tests to the volume store
Upstream-commit: bbf568e41c15b609b14a07806cc028972aa7dcd2
Component: engine
2018-03-16 09:12:55 +01:00
f89e535fb8 Windows: Fix Hyper-V containers regression from 36586
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0f5fe3f9cf17457761dab28473ece5a7c94f4a0c
Component: engine
2018-03-15 15:36:36 -07:00
3daa4b4cdd Fix stats collector spinning CPU if no stats are collected
Commit fd0e24b7189374e0fe7c55b6d26ee916d3ee1655 changed
the stats collection loop to use a `sleep()` instead
of `time.Tick()` in the for-loop.

This change caused a regression in situations where
no stats are being collected, or an error is hit
in the loop (in which case the loop would `continue`,
and the `sleep()` is not hit).

This patch puts the sleep at the start of the loop
to guarantee it's always hit.

This will delay the sampling, which is similar to the
behavior before fd0e24b7189374e0fe7c55b6d26ee916d3ee1655.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 481b8e54b45955e40075f49a9af321afce439320
Component: engine
2018-03-15 17:56:15 +01:00
5fc2230d23 add compress option for 'jsonfiles' log driver
This PR adds support for compressibility of log file.
I added a new option conpression for the jsonfile log driver,
this option allows the user to specify compression algorithm to
compress the log files. By default, the log files will be
not compressed. At present, only support 'gzip'.

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

'docker logs' can read from compressed files

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

Add Metadata to the gzip header, optmize 'readlog'

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: f69f09f44ce9fedbc9d70f11980c1fc8d7f77cec
Component: engine
2018-03-15 20:20:05 +08:00
6a0b3c07e8 integration/TestExportContainerAfterDaemonRestart: add
This test case checks that a container created before start
of the currently running dockerd can be exported (as reported
in #36561). To satisfy this condition, either a pre-existing
container is required, or a daemon restart after container
creation.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 6e7141c7a2c0de6fa3d6c9dcc56978a81f9d835e
Component: engine
2018-03-15 00:30:11 -07:00
8cec80b17b Merge pull request #36603 from thaJeztah/fix-stale-hns-endpoints
Update libnetwork to fix stale HNS endpoints on Windows
Upstream-commit: 3d14173a2900b60200d9b1475abd5138f4315981
Component: engine
2018-03-14 21:05:27 -07:00
1629147864 Merge pull request #36586 from kolyshkin/do-not-panic
ExportContainer: do not panic
Upstream-commit: ae7016427f8cba4e4d8fcb979d6ba313ee2c0702
Component: engine
2018-03-15 00:18:24 +01:00
b3b80b72e7 Merge pull request #36517 from jim-minter/missing_closewrite
ensure hijackedConn implements CloseWrite function
Upstream-commit: 518d028baab8a7d96ce59851d6fbbafcb9521c73
Component: engine
2018-03-15 00:05:54 +01:00
9c4442b73b Update libnetwork to fix stale HNS endpoints on Windows
Update libnetwork to 1b91bc94094ecfdae41daa465cc0c8df37dfb3dd to bring in a fix
for stale HNS endpoints on Windows:

When Windows Server 2016 is restarted with the Docker service running, it is
possible for endpoints to be deleted from the libnetwork store without being
deleted from HNS. This does not occur if the Docker service is stopped cleanly
first, or forcibly terminated (since the endpoints still exist in both). This
change works around the issue by removing any stale HNS endpoints for a network
when creating it.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: fb364f07468e94226250a1e77579ee6117c64be2
Component: engine
2018-03-14 23:45:58 +01:00
32e93cd766 Add some tests to the volume store
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 834d0e262ac248191c09bcdb2b86ee92edb6aaf0
Component: engine
2018-03-14 17:17:44 -04:00
4a96b47716 Update libnetwork with fixes for duplicate IP addresses
This updates libnetwork to 8892d7537c67232591f1f3af60587e3e77e61d41 to bring in
IPAM fixes for duplicate IP addresses.

- IPAM tests (libnetwork PR 2104) (no changes in vendored files)
- Fix for Duplicate IP issues  (libnetwork PR 2105)

Also bump golang/x/sync to match libnetwork (no code-changes, other
than the README being updated)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 55e0fe24db68b16edccb2fa49c3b1b9d3a9ce58c
Component: engine
2018-03-14 16:31:27 +01:00
f42054fc2d Ensure a hijacked connection implements CloseWrite whenever its underlying
connection does.  If this isn't done, then a container listening on stdin won't
receive an EOF when the client closes the stream at their end.

Signed-off-by: Jim Minter <jminter@redhat.com>
Upstream-commit: 37983921c90b468cafd3ba2ca2574fb81cafe5a7
Component: engine
2018-03-14 09:07:55 -06:00
6d58bd7ffc Merge pull request #36571 from kolyshkin/t-win-fail
integration-cli/TestSlowStdinClosing: increase timeout
Upstream-commit: 592a15b7a9a52529429cb81cee0c14983cb1cd95
Component: engine
2018-03-14 12:06:32 +01:00
f655d600ba container.BaseFS: check for nil before deref
Commit 7a7357dae1bccc ("LCOW: Implemented support for docker cp + build")
changed `container.BaseFS` from being a string (that could be empty but
can't lead to nil pointer dereference) to containerfs.ContainerFS,
which could be be `nil` and so nil dereference is at least theoretically
possible, which leads to panic (i.e. engine crashes).

Such a panic can be avoided by carefully analysing the source code in all
the places that dereference a variable, to make the variable can't be nil.
Practically, this analisys are impossible as code is constantly
evolving.

Still, we need to avoid panics and crashes. A good way to do so is to
explicitly check that a variable is non-nil, returning an error
otherwise. Even in case such a check looks absolutely redundant,
further changes to the code might make it useful, and having an
extra check is not a big price to pay to avoid a panic.

This commit adds such checks for all the places where it is not obvious
that container.BaseFS is not nil (which in this case means we do not
call daemon.Mount() a few lines earlier).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: d6ea46cedaca0098c15843c5254a337d087f5cd6
Component: engine
2018-03-13 21:24:48 -07:00
db4a8d6dcb daemon.ContainerExport(): do not panic
In case ContainerExport() is called for an unmounted container, it leads
to a daemon panic as container.BaseFS, which is dereferenced here, is
nil.

To fix, do not rely on container.BaseFS; use the one returned from
rwlayer.Mount().

Fixes: 7a7357dae1bccc ("LCOW: Implemented support for docker cp + build")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 81f6307eda44ab3a91de6e29304810a976161d74
Component: engine
2018-03-13 21:24:43 -07:00
04f51ce3f0 Merge pull request #36577 from cpuguy83/info_tweaks
Minor optimizations
Upstream-commit: 9e1c4f9906176ee120398d1568e8ff395382d675
Component: engine
2018-03-13 16:48:45 -04:00