Commit Graph

34311 Commits

Author SHA1 Message Date
b1dfd77fa4 Set daemon root to use shared propagation
This change sets an explicit mount propagation for the daemon root.
This is useful for people who need to bind mount the docker daemon root
into a container.

Since bind mounting the daemon root should only ever happen with at
least `rlsave` propagation (to prevent the container from holding
references to mounts making it impossible for the daemon to clean up its
resources), we should make sure the user is actually able to this.

Most modern systems have shared root (`/`) propagation by default
already, however there are some cases where this may not be so
(e.g. potentially docker-in-docker scenarios, but also other cases).
So this just gives the daemon a little more control here and provides
a more uniform experience across different systems.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: a510192b86e7eb1e1112f3f625d80687fdec6578
Component: engine
2018-01-23 14:17:08 -08:00
544ec9eef9 Merge pull request #36019 from thaJeztah/improve-config-reload
improve daemon config reload; log active configuration
Upstream-commit: 99cfb5f31ad82238573de3475bf5bb0435ac1ebc
Component: engine
2018-01-22 17:58:25 -08:00
50c6561a9e Merge pull request #35949 from yongtang/34248-carry
Carry #34248 Added tag log option to json-logger and use RawAttrs
Upstream-commit: ea74dbe907f534ba2f59c1173330987c3fa84208
Component: engine
2018-01-22 15:02:54 -08:00
928478219f Merge pull request #36013 from thaJeztah/improve-version-middleware-test
Improve API version-middleware test
Upstream-commit: fbed4eb8c72f56437f2a451f9cd9405814882e2a
Component: engine
2018-01-22 14:59:06 -08:00
36e0e57cbe Log active configuration when reloading
When succesfully reloading the daemon configuration, print a message
in the logs with the active configuration:

    INFO[2018-01-15T15:36:20.901688317Z] Got signal to reload configuration, reloading from: /etc/docker/daemon.json
    INFO[2018-01-14T02:23:48.782769942Z] Reloaded configuration: {"mtu":1500,"pidfile":"/var/run/docker.pid","data-root":"/var/lib/docker","exec-root":"/var/run/docker","group":"docker","deprecated-key-path":"/etc/docker/key.json","max-concurrent-downloads":3,"max-concurrent-uploads":5,"shutdown-timeout":15,"debug":true,"hosts":["unix:///var/run/docker.sock"],"log-level":"info","swarm-default-advertise-addr":"","metrics-addr":"","log-driver":"json-file","ip":"0.0.0.0","icc":true,"iptables":true,"ip-forward":true,"ip-masq":true,"userland-proxy":true,"disable-legacy-registry":true,"experimental":false,"network-control-plane-mtu":1500,"runtimes":{"runc":{"path":"docker-runc"}},"default-runtime":"runc","oom-score-adjust":-500,"default-shm-size":67108864,"default-ipc-mode":"shareable"}

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 8378dcf46d017c70df97d6f851e0196b113b422e
Component: engine
2018-01-21 00:56:02 +01:00
c2b247fce6 Move reload-related functions to reload.go
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 6121a8429b9d3a6d20e900c521c2f50fff5db406
Component: engine
2018-01-21 00:55:49 +01:00
c9b8ded195 Merge pull request #35919 from yongtang/35333-carry
Carry #35333: Devicemapper: ignore Nodata errors when delete thin device
Upstream-commit: db5c006bc8654ab1e4c24a1a9f460bbe4039686e
Component: engine
2018-01-20 18:47:16 +01:00
dbd159de4c Merge pull request #36065 from Microsoft/jjh/bumprs3andlcowsupported
Bump to RS3 final build, and remove LCOW_SUPPORTED
Upstream-commit: ef3f7d18da40cda7f33858b787161773d7656714
Component: engine
2018-01-20 19:53:30 +09:00
bde2b4704d Merge pull request #35830 from cpuguy83/unbindable_shm
Make container shm parent unbindable
Upstream-commit: c162e8eb417bbc124c1f89f676aea081ebb6251f
Component: engine
2018-01-19 17:43:30 -08:00
946a37c1e4 Merge pull request #35744 from ndeloof/35702
closes #35702 introduce « exec_die » event
Upstream-commit: f97256cbf1811740cfa9a72f705c8a70195cd468
Component: engine
2018-01-19 15:03:50 -08:00
2859d16079 Merge pull request #35986 from thaJeztah/bump-containerd-1.0.1-rc1
Bump containerd to 1.0.1 (9b55aab90508bd389d7654c4baf173a981477d55)
Upstream-commit: 47a0dcbcd20aa2924c89a38a16a60907506ae4f2
Component: engine
2018-01-19 15:48:36 -05:00
30c97f4539 Merge pull request #36003 from pradipd/upgrade_fix
Fixing ingress network when upgrading from 17.09 to 17.12.
Upstream-commit: 949ee0e5297408e97c9b5444d500a2cecab06609
Component: engine
2018-01-19 15:46:50 -05:00
5e6be7b1c2 Bump RS3 final build, and remove LCOW_SUPPORTED
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 5b24976ad4046a9c071b75df31d9269ad2e84732
Component: engine
2018-01-19 12:22:56 -08:00
12ceea25e6 Merge pull request #36051 from Microsoft/jjh/remotefs-read-return-error
LCOW remotefs - return error in Read() implementation
Upstream-commit: 3c9d023af3428f49241a2e2385dae43151185466
Component: engine
2018-01-19 11:27:13 -08:00
621663ea5d Merge pull request #36061 from adampointer/36060-fix-name-clash
Alias container and network packages to stop name clashes 
Upstream-commit: 507b8be5b3c02d2b99393d5613a6a59071e13786
Component: engine
2018-01-19 09:53:06 -08:00
3cf8a0c442 Carry 34248 Added tag log option to json-logger and use RawAttrs
This fix carries PR 34248: Added tag log option to json-logger

This fix changes to use RawAttrs based on review feedback.

This fix fixes 19803, this fix closes 34248.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: e77267c5a682e2c5aaa32469f2c83c2479d57566
Component: engine
2018-01-19 17:51:20 +00:00
9dd65d097b Added tag log option to json-logger
Fixes #19803
Updated the json-logger to utilize the common log option
'tag' that can define container/image information to include
as part of logging.

When the 'tag' log option is not included, there is no change
to the log content via the json-logger. When the 'tag' log option
is included, the tag will be parsed as a template and the result
will be stored within each log entry as the attribute 'tag'.

Update: Removing test added to integration_cli as those have been deprecated.
Update: Using proper test calls (require and assert) in jsonfilelog_test.go based on review.
Update: Added new unit test configs for logs with tag. Updated unit test error checking.
Update: Cleanup check in jsonlogbytes_test.go to match pending changes in PR #34946.
Update: Merging to correct conflicts from PR #34946.

Signed-off-by: bonczj <josh.bonczkowski@gmail.com>
Upstream-commit: 5f50f4f511cd84e79bf005817af346b1764df27f
Component: engine
2018-01-19 17:41:19 +00:00
d00d4e32b9 Merge pull request #34859 from Microsoft/jjh/singleimagestore
LCOW: Coalesce daemon stores, allow dual LCOW and WCOW mode
Upstream-commit: bb6ce897378b4ebd0131fd835b01ad5f9af3ebb9
Component: engine
2018-01-19 11:38:30 -05:00
ed76e0e519 Alias container and network packages to stop name clashes
Signed-off-by: Adam Pointer <adam.pointer@gmx.com>
Upstream-commit: 7732ca94fc67a28cbd37c292dc29216255685eba
Component: engine
2018-01-19 10:26:41 +00:00
ebd586c561 LCOW remotefs - return error in Read() implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6112ad6e7d5d7f5afc698447da80f91bdbf62720
Component: engine
2018-01-18 17:46:58 -08:00
3ca8db9a46 Remove OS() from layer interface
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: c94d34f783944ff6586846ccd11e86925fcee171
Component: engine
2018-01-18 12:56:28 -08:00
40b95b8e94 Address feedback from Tonis
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0cba7740d41369eee33b671f26276325580bc07b
Component: engine
2018-01-18 12:30:39 -08:00
9e8b44781f Merge pull request #35965 from thaJeztah/fix-volume-create-statuscode
Return 400 status instead of 500 for empty volume create body
Upstream-commit: 39377bb96d459d2ef59bd2bad75468638a7f86a3
Component: engine
2018-01-18 20:02:33 +01:00
b4c44961cf Merge pull request #36030 from cpuguy83/quota_update
Ensure CPU quota/period updates are sent to runc
Upstream-commit: 0fa3962b8d8d78020c7e636c4bcea14d618929e1
Component: engine
2018-01-18 19:54:10 +01:00
852153685d LCOW: Refactor to multiple layer-stores based on feedback
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: afd305c4b5682fbc297e1685e2b7a49628b7c7f0
Component: engine
2018-01-18 08:31:05 -08:00
33860da10b LCOW: Re-coalesce stores
Signed-off-by: John Howard <jhoward@microsoft.com>

The re-coalesces the daemon stores which were split as part of the
original LCOW implementation.

This is part of the work discussed in https://github.com/moby/moby/issues/34617,
in particular see the document linked to in that issue.
Upstream-commit: ce8e529e182bde057cdfafded62c210b7293b8ba
Component: engine
2018-01-18 08:29:19 -08:00
ce1ad508f6 Merge pull request #35960 from abhi/service
Disable service on release network
Upstream-commit: 6feae060033544985e548dcf1b9127f8f634fe2b
Component: engine
2018-01-18 11:19:47 -05:00
2096535fce 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>
Upstream-commit: d1c34831e930c1f6b3de28cab3f4a358845a79d5
Component: engine
2018-01-18 10:08:12 +01:00
8d6e00613b Bump runc to 7f24b40cc5423969b4554ef04ba0b00e2b4ba010
matching the version that's used by containerd 1.0.1

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: f58aa31075bf74ab8d2369dafb591ae43ed36ee6
Component: engine
2018-01-18 10:07:50 +01:00
c6678dac69 Bump containerd to 1.0.1 (9b55aab90508bd389d7654c4baf173a981477d55)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 9047f66b1edd4dffcafc34f9c7f3390ddd65d10b
Component: engine
2018-01-18 10:06:37 +01:00
2b31b5d6e4 libnetwork vendor
Signed-off-by: abhi <abhi@docker.com>
Upstream-commit: dad093cc34497bb7912c769e469a3e79a0c2c63c
Component: engine
2018-01-17 14:20:04 -08:00
2012c45c5a Disable service on release network
This PR contains a fix for moby/moby#30321. There was a moby/moby#31142
PR intending to fix the issue by adding a delay between disabling the
service in the cluster and the shutdown of the tasks. However
disabling the service was not deleting the service info in the cluster.
Added a fix to delete service info from cluster and verified using siege
to ensure there is zero downtime on rolling update of a service.In order
to support it and ensure consitency of enabling and disable service knob
from the daemon, we need to ensure we disable service when we release
the network from the container. This helps in making the enable and
disable service less racy. The corresponding part of libnetwork fix is
part of docker/libnetwork#1824

Signed-off-by: abhi <abhi@docker.com>
Upstream-commit: a042e5a20a7801efc936daf7a639487bb37ca966
Component: engine
2018-01-17 14:19:51 -08:00
d782361adb Merge pull request #36043 from Microsoft/jjh/fixopenfilecall
LCOW: Fix OpenFile parameters
Upstream-commit: ef3988a81f5dca972b129df527f3e4f8bba200b8
Component: engine
2018-01-17 12:03:11 -08:00
28df99f4fa Merge pull request #35697 from sargun/use-pgzip
Make image (layer) downloads faster by using pigz
Upstream-commit: 871afbb304422877e683cbafc0ebd0b029b85379
Component: engine
2018-01-17 11:18:20 -08:00
0986b8a32c 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>
Upstream-commit: 2d7a50e5855ad0571e76d29cd1ab9f8f3a48433b
Component: engine
2018-01-17 17:11:18 +00:00
5a20e1240c LCOW: Fix OpenFile parameters
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 141b9a74716c016029badf16aca21dc96975aaac
Component: engine
2018-01-17 07:58:18 -08:00
0e51141e24 Merge pull request #35441 from cpuguy83/plugin_timeout
Add timeouts for volume plugin ops
Upstream-commit: f0b0f2038d085066f340f24f3a9a9683bd4aa35f
Component: engine
2018-01-17 14:49:41 +01:00
19e1833a23 Merge pull request #36033 from cpuguy83/improve_zfs_debug_message
Improve zfs init log message for zfs
Upstream-commit: 1338fcf58aafed25c0da4952793fec1c4055c894
Component: engine
2018-01-16 21:03:53 -08:00
eaa41c5725 Merge pull request #36036 from kolyshkin/plugins
daemon.cleanupMetricsPlugins(): fix
Upstream-commit: 991d64eeb3ee97078a03b88185bee177c6551896
Component: engine
2018-01-17 13:54:46 +09:00
dede819b22 Merge pull request #36034 from dnephin/update-gty
update gotestyourself vendor
Upstream-commit: d84b8802b9fab72c0b66520e54a26c605ddee00b
Component: engine
2018-01-16 19:42:54 -08:00
a5a13dc0e0 Merge pull request #36035 from kolyshkin/gometalinter
gometalinter: fix --deadline option
Upstream-commit: 5488cce5d2effca1e9ae82d8d73d667cf878fd14
Component: engine
2018-01-17 12:04:01 +09:00
4a656e30d0 Improve zfs init log message for zfs
Signed-off-by: Drew Hubl <drew.hubl@gmail.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 27b002f4a02e2d9f6eded9004b82cb81f121264f
Component: engine
2018-01-16 21:42:05 -05:00
7da3044682 Add timeouts for volume plugin ops
This protects the daemon from volume plugins that are slow or
deadlocked.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b15f8d2d4f054a87052a7065c50441f7e8479fa9
Component: engine
2018-01-16 20:30:49 -05:00
d8a82d08f1 daemon.cleanupMetricsPlugins(): fix
A linter (vet) found the following bug in the code:

> daemon/metrics.go:124::error: range variable p captured by func literal (vet)

Here a variable p is used in an async fashion by goroutine, and most
probably by the time of use it is set to the last element of a range.

For example, the following code

```go
	for _, c := range []string{"here ", "we ", "go"} {
		go func() {
			fmt.Print(c)
		}()
	}
```

will print `gogogo` rather than `here we go` as one would expect.

Fixes: 0e8e8f0f31 ("Add support for metrics plugins")
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: 9db2c62488734a44a4f1bb9a0252c520b787acfe
Component: engine
2018-01-16 15:15:11 -08:00
374fd77d92 update gotestyourself
pickup changes which use t.Helper()

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 4ac4b690f78a645cc50030b81077fd5319b53501
Component: engine
2018-01-16 17:43:47 -05:00
cd6c81a6fb gometalinter: fix --deadline option
1. Add = between the option and the argument, otherwise the argument
   appears to be passed on to the linters directly, as in:

> DEBUG: [golint.8]: executing /home/kir/go/bin/golint
> -min_confidence 0.800000 ./10m ./api ./api/errdefs <...>

2. Fix setting the default for GOMETALINTER_OPTS -- the default
   was -deadline (rather than --deadline).

Fixes: b96093fa56a9 ("gometalinter: add per-platform configurable options")

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Upstream-commit: c11508a5f405084da13c35ee7ab62f1670e4da39
Component: engine
2018-01-16 14:37:11 -08:00
a19065e951 Make container resource mounts unbindable
It's a common scenario for admins and/or monitoring applications to
mount in the daemon root dir into a container. When doing so all mounts
get coppied into the container, often with private references.
This can prevent removal of a container due to the various mounts that
must be configured before a container is started (for example, for
shared /dev/shm, or secrets) being leaked into another namespace,
usually with private references.

This is particularly problematic on older kernels (e.g. RHEL < 7.4)
where a mount may be active in another namespace and attempting to
remove a mountpoint which is active in another namespace fails.

This change moves all container resource mounts into a common directory
so that the directory can be made unbindable.
What this does is prevents sub-mounts of this new directory from leaking
into other namespaces when mounted with `rbind`... which is how all
binds are handled for containers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: eaa5192856c1ad09614318e88030554b96bb6e81
Component: engine
2018-01-16 15:09:05 -05:00
1c29e89e9b Return 400 status instead of 500 for empty volume create body
The `POST /volumes/create` expects a request body to be provided.
If no body was provided, a 500 status was returned. A 500 status
is incorrect, because the request is invalid (it's not a server
error).

Before this change:

    $ curl --unix-socket /var/run/docker.sock -v -X POST http://localhost/volumes/create

    *   Trying /var/run/docker.sock...
    * Connected to localhost (/Users/sebastiaan/Library/Containers/com.dock) port 80 (#0)
    > POST /volumes/create HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.51.0
    > Accept: */*
    >
    < HTTP/1.1 500 Internal Server Error
    < Api-Version: 1.30
    < Content-Length: 18
    < Content-Type: application/json
    < Date: Wed, 19 Jul 2017 11:29:26 GMT
    < Docker-Experimental: true
    < Ostype: linux
    < Server: Docker/17.06.0-ce (linux)
    <
    {"message":"EOF"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

After this change:

    $ curl --unix-socket /var/run/docker.sock -v -X POST http://localhost/volumes/create

    *   Trying /var/run/docker.sock...
    * Connected to localhost (/var/run/docker.sock) port 80 (#0)
    > POST /volumes/create HTTP/1.1
    > Host: localhost
    > User-Agent: curl/7.52.1
    > Accept: */*
    >
    < HTTP/1.1 400 Bad Request
    < Api-Version: 1.36
    < Content-Type: application/json
    < Docker-Experimental: false
    < Ostype: linux
    < Server: Docker/dev (linux)
    < Date: Tue, 09 Jan 2018 15:00:13 GMT
    < Content-Length: 42
    <
    {"message":"no body provided in request"}
    * Curl_http_done: called premature == 0
    * Connection #0 to host localhost left intact

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 5ad1e4be6bd2fd1033bc2adb5be2fe821787b59c
Component: engine
2018-01-16 20:42:44 +01:00
e9c2f9fe77 Make image (layer) downloads faster by using pigz
The Golang built-in gzip library is serialized, and fairly slow
at decompressing. It also only decompresses on demand, versus
pipelining decompression.

This change switches to using the pigz external command
for gzip decompression, as opposed to using the built-in
golang one. This code is not vendored, but will be used
if it autodetected as part of the OS.

This also switches to using context, versus a manually
managed channel to manage cancellations, and synchronization.
There is a little bit of weirdness around manually having
to cancel in the error cases.

Signed-off-by: Sargun Dhillon <sargun@sargun.me>
Upstream-commit: fd35494a251a497c359f706f61f33e689e2af678
Component: engine
2018-01-16 10:49:18 -08:00
fe856d6a3e Ensure CPU quota/period updates are sent to runc
Fixes an issue where if cpu quota/period is sent via the update API, the
values are updated in the stored container data but not actually sent to
the running container.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 86ba63db82e87c943c9dee52559118e46f23defc
Component: engine
2018-01-16 11:50:14 -05:00