Commit Graph

32189 Commits

Author SHA1 Message Date
7cb8389345 Use rslave propagation for mounts from daemon root
By default, if a user requests a bind mount it uses private propagation.
When the source path is a path within the daemon root this, along with
some other propagation values that the user can use, causes issues when
the daemon tries to remove a mountpoint because a container will then
have a private reference to that mount which prevents removal.

Unmouting with MNT_DETATCH can help this scenario on newer kernels, but
ultimately this is just covering up the problem and doesn't actually
free up the underlying resources until all references are destroyed.

This change does essentially 2 things:

1. Change the default propagation when unspecified to `rslave` when the
source path is within the daemon root path or a parent of the daemon
root (because everything is using rbinds).
2. Creates a validation error on create when the user tries to specify
an unacceptable propagation mode for these paths...
basically the only two acceptable modes are `rslave` and `rshared`.

In cases where we have used the new default propagation but the
underlying filesystem is not setup to handle it (fs must hvae at least
rshared propagation) instead of erroring out like we normally would,
this falls back to the old default mode of `private`, which preserves
backwards compatibility.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 589a0afa8cbe39b6512662fd1705873e2d236dd0)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2018-02-15 10:20:07 -05:00
602216ce56 Merge pull request #395 from thaJeztah/17.12-backport-runc-hang
[17.12] Update runc to fix hang during start and exec
2018-02-13 09:36:55 -08:00
7ec8b355f2 Merge pull request #423 from thaJeztah/17.12-backport-orca-11380
[17.12] fix verbose for partial overlay ID
2018-02-13 09:17:41 -08:00
f5152d8714 Merge pull request #392 from thaJeztah/17.12-backport-ramdisk
[17.12] Honor DOCKER_RAMDISK with containerd 1.0
2018-02-13 09:05:01 -08:00
e9f1a359d7 Merge pull request #404 from thaJeztah/17.12-backport-fix-plural-singular-node-generic-resources
[17.12] backport fix plural singular node generic resources
2018-02-13 09:02:50 -08:00
8d3d4fa90a fix verbose for partial overlay ID
Signed-off-by: Dani Louca <dani.louca@docker.com>
(cherry picked from commit 2e0990f1655d151b741e7f7f78ac55e14398339f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-13 14:11:40 +01:00
831e67711b Merge pull request #383 from thaJeztah/17.12-backport-32838-partial-fix
[17.12] Vendor Microsoft/hcsshim @ v0.6.8
2018-02-12 23:10:42 -08:00
3cfc217709 Merge pull request #371 from thaJeztah/backport-FIX35843
[17.12] Backport "fix #35843 regression on health check workingdir"
2018-02-12 22:55:36 -08:00
fa49979990 Merge pull request #368 from anusha-ragunathan/backport_35726
[17.12] awslogs: Use batching type for ergonomics and correct counting
2018-02-12 22:53:57 -08:00
62a24759f6 Merge pull request #372 from thaJeztah/backport-vfs-quota
[17.12] Fix VFS vs quota regression
2018-02-12 18:44:41 -08:00
2d24bc5e5f Merge pull request #374 from thaJeztah/17.12-backport-fix-namespace-filtering
[17.12] Fix event filter filtering on "or"
2018-02-12 18:43:13 -08:00
d852c51a7d Merge pull request #389 from thaJeztah/17.12-backport-upgrade_fix
[17.12] Fixing ingress network when upgrading from 17.09 to 17.12.
2018-02-12 18:38:31 -08:00
c85f7d7628 Merge pull request #418 from thaJeztah/17.12-backport-bump-golang-1.9.4
[17.12] Bump Golang to 1.9.4
2018-02-12 18:33:45 -08:00
69b85c633e Remove workaround for Nano server TP5
This workaround for golang/go#15286 was added for Nano server TP5 in
fa82c0aa10cfac8c6d5e2446876dc79b2b0c1bf9, and should no longer be
needed

Due to a security fix in Go 1.9.4/1.8.7, loading the .dll is no longer
allowed, and produces an error:

   .\docker_windows.go:9:3: //go:cgo_import_dynamic main.dummy CommandLineToArgvW%2 "shell32.dll" only allowed in cgo-generated code

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 250193387c98a4ad69a6591d5fe5a39c1409ffba)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-08 14:58:10 -08:00
84d4132c8d Bump Golang to 1.9.4
This fixes a vulnerability in `go get` (CVE-2018-6574, http://golang.org/issue/23672),
but shouldn't really affect our code, but it's good to keep in sync.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit caeab268430a033fedd27c53be16758ac1a0f71e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-08 14:58:03 -08:00
dbf4d3a8ca Refresh containerd remotes on containerd restarted
Before this patch, when containerd is restarted (due to a crash, or
kill, whatever), the daemon would keep trying to process the event
stream against the old socket handles. This would lead to a CPU spin due
to the error handling when the client can't connect to containerd.

This change makes sure the containerd remote client is updated for all
registered libcontainerd clients.

This is not neccessarily the ideal fix which would likely require a
major refactor, but at least gets things to a working state with a
minimal patch.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 400126f8698233099259da967378c0a76bc3ea31)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-08 13:59:07 -08:00
092f60f9eb Fix typo in log-message
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5c3418e38b9603e8ff582d53c2face57f0f01cce)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-02-08 13:58:57 -08:00
ea3ea188f6 Fix "--node-generic-resource" singular/plural
Daemon flags that can be specified multiple times use
singlar names for flags, but plural names for the configuration
file.

To make the daemon configuration know how to correlate
the flag with the corresponding configuration option,
`opt.NewNamedListOptsRef()` should be used instead of
`opt.NewListOptsRef()`.

Commit 6702ac590e6148cb3f606388dde93a011cb14931 attempted
to fix the daemon not corresponding the flag with the configuration
file option, but did so by changing the name of the flag
to plural.

This patch reverts that change, and uses `opt.NewNamedListOptsRef()`
instead.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 6e7715d65ba892a47d355e16bf9ad87fb537a2d0)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-30 14:44:15 -08:00
f0cfc346fd Fix node-generic-resources CLI typo
Signed-off-by: Renaud Gaubert <rgaubert@nvidia.com>
(cherry picked from commit 6702ac590e6148cb3f606388dde93a011cb14931)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-30 14:44:08 -08:00
1d1bcb2fca Bump Go to 1.9.3
release notes: https://golang.org/doc/devel/release.html#go1.9.minor

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 3cc13511f0c8d7f3aeb382f0444e37592a8b5e69)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-26 15:32:47 -08:00
09d84539fa Update runc to fix hang during start and exec
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit d10091c86e75fb78eaba96f433dc2cc06c0a54de)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-23 16:51:30 -08:00
67d4bb5888 Honor DOCKER_RAMDISK with containerd 1.0
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
(cherry picked from commit 54051e9e64185e442e034c7e49a5707459a9eed2)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-20 01:59:41 +01:00
5507d73275 Fixes for libcontainer changes
Libcontainer no longer provides placeholders for
unsupported platforms, which cause the Windows
builds to fail.

This patch moves features that are not supported
to platform-specific files.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d1c34831e930c1f6b3de28cab3f4a358845a79d5)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-20 01:14:44 +01:00
1e67593a37 Bump runc to 7f24b40cc5423969b4554ef04ba0b00e2b4ba010
matching the version that's used by containerd 1.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f58aa31075bf74ab8d2369dafb591ae43ed36ee6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-20 00:43:37 +01:00
25c4322a30 Bump containerd to 1.0.1 (9b55aab90508bd389d7654c4baf173a981477d55)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 9047f66b1edd4dffcafc34f9c7f3390ddd65d10b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-20 00:22:51 +01:00
5f1c192c19 Fixing ingress network when upgrading from 17.09 to 17.12.
Signed-off-by: Pradip Dhara <pradipd@microsoft.com>

Signed-off-by: Pradip Dhara <pradipd@microsoft.com>
(cherry picked from commit 2d7a50e5855ad0571e76d29cd1ab9f8f3a48433b)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-20 00:03:55 +01:00
276c2ad6a4 Vendor Microsoft/hcsshim @ v0.6.8
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 172a442c27ed35778662980809824fdf15a722a6)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-04 17:53:07 +01:00
ae80c6aedf Fix event filter filtering on "or"
The event filter used two separate filter-conditions for
"namespace" and "topic". As a result, both events matching
"topic" and events matching "namespace" were subscribed to,
causing events to be handled both by the "plugin" client, and
"container" client.

This patch rewrites the filter to match only if both namespace
and topic match.

Thanks to Stephen Day for providing the correct filter :)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 295bb09184fe473933498bb0efb59b8acb124f55)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-01-02 13:43:28 +01:00
a7ee159424 vfs gd: ignore quota setup errors
This is a fix to regression in vfs graph driver introduced by
commit 7a1618ced359a3ac92 ("add quota support to VFS graphdriver").

On some filesystems, vfs fails to init with the following error:

> Error starting daemon: error initializing graphdriver: Failed to mknod
> /go/src/github.com/docker/docker/bundles/test-integration/d6bcf6de610e9/root/vfs/backingFsBlockDev:
> function not implemented

As quota is not essential for vfs, let's ignore (but log as a warning) any error
from quota init.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 1e8a087850aa9f96c5000a3ad90757d2e9c0499f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-29 16:08:02 +01:00
092e59ef76 projectquota: treat ENOSYS as quota unsupported
If mknod() returns ENOSYS, it most probably means quota is not supported
here, so return the appropriate error.

This is a conservative* fix to regression in vfs graph driver introduced
by commit 7a1618ced359a3ac92 ("add quota support to VFS graphdriver").
On some filesystems, vfs fails to init with the following error:

> Error starting daemon: error initializing graphdriver: Failed to mknod
> /go/src/github.com/docker/docker/bundles/test-integration/d6bcf6de610e9/root/vfs/backingFsBlockDev:
> function not implemented

Reported-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
(cherry picked from commit 2dd39b7841bdb9968884bbedc5db97ff77d4fe3e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-29 16:07:54 +01:00
bf9d7adabe Add integration test for healthcheck workdir
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 5be2f2be243a52eb1b051c981bac5442b6e85606)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-29 16:02:24 +01:00
88f57f81f9 fix #35843 regression on health check workingdir
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
(cherry picked from commit 852a943c773382df09cdda4f29f9e93807523178)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-29 16:02:15 +01:00
f8b1976d4c daemon, plugin: follow containerd namespace conventions
Follow the conventions for namespace naming set out by other projects,
such as linuxkit and cri-containerd. Typically, they are some sort of
host name, with a subdomain describing functionality of the namespace.
In the case of linuxkit, services are launched in `services.linuxkit`.
In cri-containerd, pods are launched in `k8s.io`, making it clear that
these are from kubernetes.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
(cherry picked from commit 521e7eba86df25857647b93f13e5366c554e9d63)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-19 23:56:30 +00:00
aad5f42ada Merge pull request #366 from seemethere/cherry_pick_engine_35805
[17.12] Ensure containers are stopped on daemon startup
2017-12-19 16:49:04 -06:00
351bf41f51 awslogs: Use batching type for ergonomics and correct counting
The previous bytes counter was moved out of scope was not counting the
total number of bytes in the batch. This type encapsulates the counter
and the batch for consideration and code ergonomics.

Signed-off-by: Jacob Vallejo <jakeev@amazon.com>
(cherry picked from commit ad14dbf1346742f0607d7c28a8ef3d4064f5f9fd)
Signed-off-by: Anusha Ragunathan <anusha.ragunathan@docker.com>
2017-12-19 13:39:22 -08:00
59c59ce2f5 Merge pull request #365 from seemethere/bump_swarmkit_17_12
[17.12] bump swarmkit to 7598f7a
2017-12-19 12:26:45 -08:00
65b3c804b5 Ensure containers are stopped on daemon startup
When the containerd 1.0 runtime changes were made, we inadvertantly
removed the functionality where any running containers are killed on
startup when not using live-restore.
This change restores that behavior.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e69127bd5ba4dcf8ae1f248db93a95795eb75b93)
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-19 20:23:41 +00:00
fcbcbec6b1 Merge pull request #362 from thaJeztah/17.12-backport-fix_container_zombies
[17.12] backport fix container zombies
2017-12-19 10:37:49 -08:00
ee3330bc06 Merge pull request #360 from thaJeztah/17.12-backport-33107
[17.12] Windows: Case-insensitive filename matching against builder cache
2017-12-19 10:35:44 -08:00
52f2c25c69 bump swarmkit to 7598f7a
Signed-off-by: Eli Uriegas <eli.uriegas@docker.com>
2017-12-19 18:11:40 +00:00
332e30b02e Fix some missing synchronization in libcontainerd
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit 647cec4324186faa3183bd6a7bc72a032a86c8c9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-16 01:22:18 -08:00
0a4c60553a Fix error handling for kill/process not found
With the contianerd 1.0 migration we now have strongly typed errors that
we can check for process not found.
We also had some bad error checks looking for `ESRCH` which would only
be returned from `unix.Kill` and never from containerd even though we
were checking containerd responses for it.

Fixes some race conditions around process handling and our error checks
that could lead to errors that propagate up to the user that should not.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e55bead518e4c72cdecf7de2e49db6c477cb58eb)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-16 01:22:06 -08:00
2802af349a Windows: Case-insensitive filename matching against builder cache
Signed-off-by: John Howard <jhoward@microsoft.com>
(cherry picked from commit 7caa30e8937b65ad9fd61a8b811bba470d22809f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-15 02:05:31 -08:00
e4e75fe503 Remove support for referencing images by 'repository:shortid'
The `repository:shortid` syntax for referencing images is very little used,
collides with with tag references can be confused with digest references.

The `repository:shortid` notation was deprecated in Docker 1.13 through
5fc71599a0b77189f0fedf629ed43c7f7067956c, and scheduled for removal
in Docker 17.12.

This patch removes the support for this notation.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit a942c92dd77aff229680c7ae2a6de27687527b8a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-15 01:40:50 -08:00
3083961ff0 Merge pull request #356 from jose-bigio/17.12_backport_network_partition
[17.12] backport network partition to 7dd202d11b2078c063fefc614c9fb9e4615da0e1
2017-12-13 16:31:06 -08:00
c69b9c5296 Merge pull request #350 from thaJeztah/17.12-backport-use-commit-instead-of-version
[17.12] Use commit-sha instead of tag for containerd
2017-12-13 16:06:51 -08:00
6eb0519584 Merge pull request #349 from thaJeztah/17.12-backport-disallow-v1-registries
[17.12] Disallow using legacy (V1) registries
2017-12-13 16:03:59 -08:00
a6dd5c1211 Bump libnetwork to 7dd202d11b2078c063fefc614c9fb9e4615da0e1
Signed-off-by: jose-bigio <jose.bigio@docker.com>
2017-12-13 15:15:19 -08:00
02f4c4289a Update Graylog2/go-gelf vendoring. Fixes #35613
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
(cherry picked from commit f9f3c49302fc80e586e3cb10af43114929556b47)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-12 16:41:18 -08:00
f4f23ddb6b Fix vendoring of go-gelf to point to specific commit ID
Signed-off-by: Ghislain Bourgeois <ghislain.bourgeois@gmail.com>
(cherry picked from commit 5bc11021250e39e71ca9edf62ce5c33f15c3756f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-12-12 16:41:11 -08:00