Commit Graph

34784 Commits

Author SHA1 Message Date
fe74b4e69a Builder - add --platform to FROM statement
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 7f0c2d23e11485c7f026dd8c111c60c2e1e03375
Component: engine
2018-03-19 14:29:36 -07:00
96ca7d0f59 Builder - Parser. Remove platform parser directive
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9cae03900fc27ff39e913978ca8f084691954881
Component: engine
2018-03-19 14:29:35 -07:00
bf670c6435 Builder - dockerfile - just use API for now, and unit test fix
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 735e5d22b7ca208acc9ad7373bb8f93167ee3f85
Component: engine
2018-03-19 14:29:35 -07:00
66621995e0 Builder - parser - remove OS
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 98dd1fdca1f5b82cbc7066c4a48f9ddd8f135095
Component: engine
2018-03-19 14:29:35 -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
e1d37225cd Merge pull request #36589 from thaJeztah/fix-duplicate-ip-issues
Update libnetwork with fixes for duplicate IP addresses
Upstream-commit: bc0b0f11f3a75a4a8f058d9ceb3d098cf39a091e
Component: engine
2018-03-14 15:04:41 -07: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
951f082fa9 Merge pull request #36538 from ctelfer/ingress-fix
Fix automatic removal of ingress sandbox when last service leaves
Upstream-commit: 514fb6cf859f5d40e4100920b0da1410e51f23bd
Component: engine
2018-03-13 20:56:03 +01:00
2c6fe9c524 Change containerd monitor ticker to sleep
With the ticker this could end up just doing back-to-back checks, which
isn't really what we want here.
Instead use a sleep to ensure we actually sleep for the desired
interval.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 04a0d6b863ed50cfffa79936cf9cdab7a3a9e7df
Component: engine
2018-03-13 13:20:19 -04:00
d15385dab8 Add Len() to image store for info endpoint
In info, we only need the number of images, but `CountImages` was
getting the whole map of images and then grabbing the length from that.
This causes a lot of unnecessary CPU usage and memory allocations, which
increases with O(n) on the number of images.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f6a7763b6f3256bed9a7352021745189d0ca8dc9
Component: engine
2018-03-13 11:58:05 -04:00
59feac96fd Merge pull request #36569 from kolyshkin/t-etc-hosts
TestLinksEtcHostsContentMatch: use container.Exec()
Upstream-commit: fb95dc7eac3ae177d61f7bd67aea5ddeb94454b8
Component: engine
2018-03-13 15:12:59 +01:00
2dcdb5d404 Merge pull request #36567 from kolyshkin/t-parallel
integration/TestContainerShmNoLeak: use --iptables=false
Upstream-commit: 4a65cd4d6d845e895c7c8061080210d74ae5a19b
Component: engine
2018-03-13 08:36:20 -04:00
496c3cdf9d integration-cli/TestSlowStdinClosing: increase timeout
I noticed this test failed on Windows:

> 17:46:24 docker_cli_run_test.go:4361:
> 17:46:24 c.Fatal("running container timed out") // cleanup in teardown

I also noticed that in general tests are running slower on Windows,
for example TestStartAttachSilent (which runs a container with
`busybox echo test` and then starts it again) took 29.763s.
This means a simple container start can easily take 15s, which
explains the above failure.

Double the timeout from 15s to 30s.

Fixes: 4e262f6387 ("Fix race on sending stdin close event")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 5043639645123f2728c81c9a55fea525475ec324
Component: engine
2018-03-12 20:35:28 -07:00
2052fc8774 TestLinksEtcHostsContentMatch: use container.Exec()
I am not quite sure why but this test is sometimes failing like this:

> 15:21:41 --- FAIL: TestLinksEtcHostsContentMatch (0.53s)
> 15:21:41 	assertions.go:226:
>
> 	Error Trace:	links_linux_test.go:46
> 15:21:41
> 	Error:      	Not equal:
> 15:21:41
> 	            	expected: "127.0.0.1\tlocalhost\n::1\tlocalhost
> ip6-localhost
> ip6-loopback\nfe00::0\tip6-localnet\nff00::0\tip6-mcastprefix\nff02::1\tip6-allnodes\nff02::2\tip6-allrouters\n172.17.0.2\tf53feb6df161\n"
> 15:21:41
> 	            	received: ""

To eliminate some possible failures (like ignoring stderr from `cat` or
its exit code), let's use container.Exec() to read a file from a container.

Fixes: e6bd20edcbf ("Migrate some integration-cli test to api tests")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: ad2f88d8ccbd9dd0a8d9c4f96ece3956f60489df
Component: engine
2018-03-12 18:15:16 -07:00
6623004cd4 integration/TestContainerShmNoLeak: use --iptables=false
As mentioned in commit 9e31938, test cases that use t.Parallel()
and start a docker daemon might step on each other toes as they
try to configure iptables during startup, resulting in flaky tests.

To avoid this, --iptables=false should be used while starting daemon.

Fixes: eaa5192856c1 ("Make container resource mounts unbindable")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c125e10a0486623ba3badebf974ea6e582373151
Component: engine
2018-03-12 14:49:15 -07:00
48cfa9f758 Delete the load balancer endpoint in Ingress nets
Ingress networks will no longer automatically remove their
load-balancing endpoint (and sandbox) automatically when the network is
otherwise upopulated.   This is to prevent automatic removal of the
ingress networks when all the containers leave them.  Therefore
explicit removal of an ingress network also requires explicit removal
of its load-balancing endpoint.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
Upstream-commit: 3da4ebf355d3494d1403b2878a1ae6958b2724e9
Component: engine
2018-03-12 15:19:08 -04:00
06f61ef263 Update vendoring for libnetwork PR #2097
This PR prevents automatic removal of the load balancing sandbox
endpoint when the endpoint is the last one in the network but
the network is marked as ingress.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
Upstream-commit: bebad150c9c3bc6eb63758c10ef24b9298ecf6e2
Component: engine
2018-03-12 15:19:08 -04:00
7b6b17fc7d Add test for ingress removal on service removal
The commit https://github.com/moby/moby/pull/35422 had the result of
accidentally causing the removal of the ingress network when the
last member of a service left the network.  This did not appear
in swarm instances because the swarm manager would still maintain
and return cluster state about the network even though it had
removed its sandbox and endpoint.  This test verifies that after a
service gets added and removed that the ingress sandbox remains
in a functional state.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
Upstream-commit: 805b6a7f749a6c7cbb237e21ee7260d536621808
Component: engine
2018-03-12 15:19:02 -04:00
09262890a9 Merge pull request #36523 from yolken-stripe/36521-configurable-logfile-perms
Make LogFile perms configurable
Upstream-commit: 241c904e6f5fff020890a7641558e83a209c0bbd
Component: engine
2018-03-12 15:07:23 +01:00
4afacfb791 Merge pull request #36489 from thaJeztah/fix-errdef-is
Change return for errdefs.getImplementer()
Upstream-commit: c74cd60473479bc4b857a1b97e4116fd5f0bfdb0
Component: engine
2018-03-12 10:04:41 -04:00
3179450003 Merge pull request #36546 from arm64b/multi-arch-support4Dockerfiles
Unify arch-specific Dockerfiles into multi-arch one
Upstream-commit: 1790ce52e96fd66621b5d8eb2e203203874a7921
Component: engine
2018-03-12 12:36:58 +01:00
d24c1e8528 Remove arch-suffix detection of Dockerfile
Since now we have only one Dockerfile, so the arch-specific suffix
of the Dockerfile is not needed anymore.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 8eb7ed673b687ae17e2c7df5dd40f8081c299bc2
Component: engine
2018-03-12 02:05:37 +00:00
e19b73b949 Arch-specific Dockerfile removal
Removing all the existing arch-specific Dockerfiles since we already
have a new multi-arch supported one as the replacement.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: 162f9aee476bd204c2b0146c0128949182e8bd5e
Component: engine
2018-03-12 02:05:37 +00:00
56843d4319 Multiarch support for Dockerfile
This PR consolidates the existing arch-specific Dockerfiles into only
one file `Dockefile` to ease the code maintenance effort.

Signed-off-by: Dennis Chen <dennis.chen@arm.com>
Upstream-commit: f1701a741d77a92d28138944193e23aabfc74abe
Component: engine
2018-03-12 02:05:01 +00:00
de73b08b59 Merge pull request #36550 from dnephin/fix-diff-tests
Remove unnecessary diff tests
Upstream-commit: a575b0b1384b2ba89b79cbd7e770fbeb616758b3
Component: engine
2018-03-11 11:26:50 +09:00
02493cad47 Merge pull request #36526 from kolyshkin/ipc-ro
daemon/setMounts(): do not make /dev/shm ro
Upstream-commit: cda90892aaa03aab59848a79a701fd09b663c3cc
Component: engine
2018-03-10 10:30:22 -08:00
ef5c3d2c0a Merge pull request #36504 from dmcgowan/layer-store-remove-metastore-interface
layer: remove metadata store interface
Upstream-commit: b9cc5cba6964b565e8b2cf1ff50c3e946a924fc8
Component: engine
2018-03-10 12:22:08 +01:00
e11a0c3a06 Merge pull request #36519 from stevvooe/resilient-cpu-sampling
daemon/stats: more resilient cpu sampling
Upstream-commit: 623b1a5c3c7d6b4d6d5943b64bd9ae6a7813786e
Component: engine
2018-03-09 14:34:45 -08:00
1eac9f0c3c Remove unnecessary diff tests
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 038f3add5191240058c7a4154556553c5493ea44
Component: engine
2018-03-09 12:32:50 -05:00
0d25ace2cb Merge pull request #36539 from tophj-ibm/skip-oom-tests-ppc64le
[integration] skip ppc64le oom tests temporarily
Upstream-commit: c8f9e14b500b1b2e23e79c52ded0aee05579d9bc
Component: engine
2018-03-09 09:53:00 +01:00
e31b1923c7 Merge pull request #36506 from kolyshkin/pkg-mount-slice
pkg/mount: use sort.Slice
Upstream-commit: a21d5bf669571ffc7ad31b8df3c0a632dc207b78
Component: engine
2018-03-09 09:46:53 +01:00
671826c75d [integration] skip ppc64le oom tests for now
These tests were enabled by changing a config option on the ci
machines, instead of from a patch, so let me disable them
for now on ppc64le and open up another patch to enable them, where I can find
out what the issues are with them.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 620ddc78a1437feaa42f40853ef586d268991620
Component: engine
2018-03-08 17:51:37 -06:00
11d01cef44 daemon/setMounts(): do not make /dev/shm ro
It has been pointed out that if --read-only flag is given, /dev/shm
also becomes read-only in case of --ipc private.

This happens because in this case the mount comes from OCI spec
(since commit 7120976d74195), and is a regression caused by that
commit.

The meaning of --read-only flag is to only have a "main" container
filesystem read-only, not the auxiliary stuff (that includes /dev/shm,
other mounts and volumes, --tmpfs, /proc, /dev and so on).

So, let's make sure /dev/shm that comes from OCI spec is not made
read-only.

Fixes: 7120976d74195 ("Implement none, private, and shareable ipc modes")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: cad74056c09f6276b0f4a996a1511553177cd3d7
Component: engine
2018-03-08 14:04:03 -08:00
d36dd1e792 daemon/oci_linux_test: add TestIpcPrivateVsReadonly
The test case checks that in case of IpcMode: private and
ReadonlyRootfs: true (as in "docker run --ipc private --read-only")
the resulting /dev/shm mount is NOT made read-only.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 33dd562e3acff71ee18a2543d14fcbecf9bf0e62
Component: engine
2018-03-08 14:04:03 -08:00
d56f856549 Merge pull request #36518 from seemethere/fix_static_builds
Build containerd, runc, and proxy statically
Upstream-commit: 0c01629e17752749b32422e327d47764ce23baac
Component: engine
2018-03-08 13:59:34 +01:00
7856345e7b Merge pull request #36505 from kolyshkin/pkg-mount-tests
pkg/mount unit tests: skip some test under non-root
Upstream-commit: 4a1d35c546c4a5df3353f5984d86671f702a315a
Component: engine
2018-03-08 17:27:31 +09:00
882fe67e01 Make logfile perms configurable
Signed-off-by: Benjamin Yolken <yolken@stripe.com>
Upstream-commit: d0c1287a8d3aa0391b4e8bfbe867ec8f0e639a51
Component: engine
2018-03-07 15:18:51 -08:00
3398cf7be9 buildmod => buildmode
There was a typo with the buildmode flag for containerd

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 5e4885b9afb1de30133627ce751af2c0e7b72a4e
Component: engine
2018-03-07 21:36:23 +00:00
b6d64a77d2 Build containerd, runc, and proxy statically
These were originally static binaries in the first place, this changes
them back to that.

Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
Upstream-commit: 63c7bb24637fdbfd905096ecc75b435ecefd31e9
Component: engine
2018-03-07 21:29:10 +00:00
aa0ca25049 daemon/stats: more resilient cpu sampling
To avoid noise in sampling CPU usage metrics, we now sample the system
usage closer to the actual response from the underlying runtime. Because
the response from the runtime may be delayed, this makes the sampling
more resilient in loaded conditions. In addition to this, we also
replace the tick with a sleep to avoid situations where ticks can backup
under loaded conditions.

The trade off here is slightly more load reading the system CPU usage
for each container. There may be an optimization required for large
amounts of containers but the cost is on the order of 15 ms per 1000
containers. If this becomes a problem, we can time slot the sampling,
but the complexity may not be worth it unless we can test further.

Unfortunately, there aren't really any good tests for this condition.
Triggering this behavior is highly system dependent. As a matter of
course, we should qualify the fix with the users that are affected.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: fd0e24b7189374e0fe7c55b6d26ee916d3ee1655
Component: engine
2018-03-07 13:20:21 -08:00
1158d96fc9 Merge pull request #36307 from kolyshkin/dm-misc
devmapper cleanup improvements
Upstream-commit: bc7424b4434443b036604277bfcdee3fa34a268a
Component: engine
2018-03-07 12:57:21 -08:00
2c2dcf7989 Merge pull request #36451 from Microsoft/jjh/ubr
Windows: Report Version and UBR
Upstream-commit: 8cf8fe9cf80a07d4e68829f619ea2c71fbb5af0c
Component: engine
2018-03-07 06:27:01 -08:00