Commit Graph

3381 Commits

Author SHA1 Message Date
c6ef103dcf Merge pull request #22009 from rhvgoyal/docker-cp-fix
Mount volumes rprivate for archival and other use cases
Upstream-commit: a1968615176001904e58300339df8f6d7b9b7086
Component: engine
2016-04-15 10:11:33 -07:00
23c1fd9d95 Merge pull request #21006 from cpuguy83/volume_inspect_meta
Allow volume drivers to provide a `Status` field
Upstream-commit: e40e5b97c1ad540aa0be568467546f27932ef3a5
Component: engine
2016-04-15 18:53:39 +02:00
ed92db4f93 Allow volume drivers to provide a Status field
The `Status` field is a `map[string]interface{}` which allows the driver to pass
back low-level details about the underlying volume.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 36a1c56cf555f8fe9ceabeebb8fc956e05863fc7
Component: engine
2016-04-15 10:56:38 -04:00
76b4a1f20d Mount volumes rprivate for archival and other use cases
People have reported following problem.

- docker run -ti --name=foo -v /dev/:/dev/ fedora bash
- docker cp foo:/bin/bash /tmp

Once the cp operation is complete, it unmounted /dev/pts on the host. /dev/pts
is a submount of /dev/. This is completely unexpected. Following is the
reson for this behavior.

containerArchivePath() call mountVolumes() which goes through all the mounts
points of a container and mounts them in daemon mount namespace in
/var/lib/docker/devicemapper/mnt/<containerid>/rootfs dir. And once we have
extracted the data required, these are unmounted using UnmountVolumes().

Mounts are done using recursive bind (rbind). And these are unmounted using
lazy mount option on top level mount. (detachMounted()). That means if there
are submounts under top level mounts, these mount events will propagate and
they were "shared" mounts with host, it will unmount the submount on host
as well.

For example, try following.

- Prepare a parent and child mount point.
  $ mkdir /root/foo
  $ mount --bind /root/foo /root/foo 
  $ mount --make-rshared /root/foo
  
- Prepare a child mount 

  $ mkdir /root/foo/foo1
  $ mount --bind /root/foo/foo1 /root/foo/foo1
 
- Bind mount foo at bar

  $ mkdir /root/bar
  $ mount --rbind /root/foo /root/bar
  
- Now lazy unmount /root/bar and it will unmount /root/foo/foo1 as well.

  $ umount -l /root/bar

This is not unintended. We just wanted to unmount /root/bar and anything
underneath but did not have intentions of unmounting anything on source.

So far this was not a problem as docker daemon was running in a seprate
mount namespace where all propagation was "slave". That means any unmounts
in docker daemon namespace did not propagate to host namespace. 

But now we are running docker daemon in host namespace so that it is possible
to mount some volumes "shared" with container. So that if container mounts
something it propagates to host namespace as well. 

Given mountVolumes() seems to be doing only temporary mounts to read some
data, there does not seem to be a need to mount these shared/slave. Just
mount these private so that on unmount, nothing propagates and does not
have unintended consequences. 

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: cacd4007776672e918162936d8846eb51a5300e6
Component: engine
2016-04-15 14:03:11 +00:00
4e9b36b9f3 Merge pull request #20924 from Microsoft/10662-CPUResourceControls
Add CPU count and maximum resource controls for Windows
Upstream-commit: 172ca1ca8c4d5157789feb97a6424104b81a3479
Component: engine
2016-04-15 08:14:59 +02:00
b6c2e57eab Merge pull request #21172 from yongtang/20909-seccomp-in-docker-info
Show "seccomp" in docker info (#20909).
Upstream-commit: bc0c8828e9afc32f1660a1f679ed523376c7d3d2
Component: engine
2016-04-15 01:24:54 +02:00
22a06166b3 Add CPU count and maximum resource controls for Windows
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: ea8c690886970b2929d52d8b61dcfb8becc24db9
Component: engine
2016-04-14 15:40:25 -07:00
925ceebdbf Merge pull request #21970 from cpuguy83/use_cached_path_on_ls
Fix N+1 calling `Path()` on `volume ls`
Upstream-commit: 7cd420d63a708c7763bceff231873c4e73b29c31
Component: engine
2016-04-13 22:47:53 -07:00
4447d74a76 Move build endpoint handler from daemon (#21972)
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 73ac6d199cacbcdba4c062f982b31f8d57e03f3c
Component: engine
2016-04-13 10:21:00 -07:00
6761133f09 Windows: Fix Hyper-V container ACLs for TP5 (#21974)
In TP5, Hyper-V containers need all image files ACLed so that the virtual
machine process can access them. This was fixed post-TP5 in Windows, but
for TP5 we need to explicitly add these ACLs.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 6f8878872f8782d4300faeb80413c8c60f56cff1
Component: engine
2016-04-13 10:15:38 -07:00
2a0b94972b Merge pull request #19265 from rhatdan/netsysctl
Add support for setting sysctls
Upstream-commit: 988508a2b5aa18c04fd3db143b4e4f5f207ea15e
Component: engine
2016-04-13 18:36:30 +02:00
1442a95a2d Fix N+1 calling Path() on volume ls
Implements a `CachedPath` function on the volume plugin adapter that we
call from the volume list function instead of `Path.
If a driver does not implement `CachedPath` it will just call `Path`.

Also makes sure we store the path on Mount and remove the path on
Unmount.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 9e6b1852a78eda6ed2cb255d6be8a0d0e5a5ca40
Component: engine
2016-04-12 20:30:34 -04:00
13ff1eed5b Merge pull request #21714 from hallyn/2016-03-31/aufs.2
don't try to use aufs in a user namespace
Upstream-commit: 7c16063afaafaddf0b738fe9ad6221f55ee85a99
Component: engine
2016-04-12 14:07:51 -07:00
3b52ebb9ff Add support for setting sysctls
This patch will allow users to specify namespace specific "kernel parameters"
for running inside of a container.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 9caf7aeefd23263a209c26c8439d26c147972d81
Component: engine
2016-04-12 13:37:31 -04:00
28a44b680b Merge pull request #21904 from yongtang/21848-stats-connected-containers
Docker stats is not working when a container is using another container's network.
Upstream-commit: d648d40ace5440d1a3c8c9dbc1115d40ebcbae3c
Component: engine
2016-04-12 10:28:05 -07:00
e6c347efc9 Merge pull request #21943 from Microsoft/jstarks/utilityvm
Windows: support embedded utility VM images
Upstream-commit: 7b5a6844c2a517e8b6927666e33becf341ac016b
Component: engine
2016-04-12 10:19:47 -07:00
d31afa6053 Fix a typo in hostConfig.ShmSize validation
Other places referring to the same configuration, including docs, have
the correct spelling.

Signed-off-by: Rodolfo Carvalho <rhcarvalho@gmail.com>
Upstream-commit: fee7e7c7a31023be9f0c26608e6cbd4e8a97d25b
Component: engine
2016-04-12 16:45:05 +02:00
78ecc63dec Windows: Support embedded utility VM images
For TP5, the utility VM for Hyper-V containers is embedded in the base
layer's contents.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: c70f153f52c8ca75a395d4dc1c4a5759871ada19
Component: engine
2016-04-11 17:16:17 -07:00
2be81f74a1 don't try to use aufs in a user namespace
If aufs is already modprobe'd but we are in a user namespace, the
aufs driver will happily load but then get eperm when it actually tries
to do something.  So detect that condition.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Upstream-commit: 2a71f28a4e1167dee32aa16ddbc819c9d9e77f71
Component: engine
2016-04-11 13:38:15 -05:00
0e63dec985 parseStorageOpt: return size rather than updating devInfo.Size field
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 45dc5b46e2018d0a8c2d15c6b2917f3581211a6e
Component: engine
2016-04-11 10:34:13 -04:00
870a7271d1 Merge pull request #20853 from WeiZhang555/fix-ShouldRestart
Fix ShouldRestart for on-failure handle
Upstream-commit: a692910277dfbd077af4db891cab0c4130962377
Component: engine
2016-04-11 14:01:52 +02:00
b83c7378b4 Merge pull request #21724 from flyinprogrammer/syslog-opts-env-labels
enable syslog logger to have access to env and labels
Upstream-commit: f9386538ec6744512a07b61fe06e953b52065ead
Component: engine
2016-04-10 10:58:25 +02:00
c018129666 Fix ShouldRestart for on-failure handle
Currently if you restart docker daemon, all the containers with restart
policy `on-failure` regardless of its `RestartCount` will be started,
this will make daemon cost more extra time for restart.

This commit will stop these containers to do unnecessary start on
daemon's restart.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: 51e42e6ee01eb4b5c8c7678e2fc7be0f13ef6a68
Component: engine
2016-04-10 15:44:47 +08:00
afb9d9b8d8 Merge pull request #21854 from WeiZhang555/restart-failure
Fix critical bug: can't restart an restarting container
Upstream-commit: b4664e3f8669ca02925c31a08822b73ee7969bd5
Component: engine
2016-04-10 11:17:19 +08:00
7511f16a58 Docker stats is not working when a container is using another container's network.
This fix tries to fix the issue in #21848 where `docker stats` will not correctly
display the container stats in case the container reuse another container's
network stack.

The issue is that when `stats` is performed, the daemon will check for container
network setting's `SandboxID`. Unfortunately, for containers that reuse another
container's network stack (`NetworkMode.IsConnected()`), SandboxID is not assigned.
Therefore, the daemon thinks the id is invalid and remote API will never return.

This fix tries to resolve the SandboxID by iterating through connected containers
and identify the appropriate SandboxID.

A test case for `stats` remote API has been added to check if `stats` will return
within the timeout.

This fix fixes #21848.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: faf2b6f7aaca7f9ef400e227921b8125590fc9e5
Component: engine
2016-04-09 20:15:51 +00:00
9a26745f83 Merge pull request #21853 from coolljt0725/fix_stats
Fix docker stats missing mem limit
Upstream-commit: a01f4dc2292ecba30b1e3db3251e6408610f8c8f
Component: engine
2016-04-09 13:46:58 +02:00
9499ce7691 Merge pull request #20525 from Microsoft/sjw/update-graphdriver-create
Adding readOnly parameter to graphdriver Create method
Upstream-commit: fec6cd2eb988f77d7442fd8edd8cc864c87ae88b
Component: engine
2016-04-08 20:44:03 -07:00
d050e36225 Merge pull request #21839 from WeiZhang555/add-start-event
Add missing "start" event back for auto-restart container
Upstream-commit: eaa1e8a8c49c58fb3770d673c8c7dcd4c1da4d17
Component: engine
2016-04-08 17:52:22 -07:00
c931d8e5af enable syslog logger to have access to env and labels
Signed-off-by: Alan Scherger <flyinprogrammer@gmail.com>
Upstream-commit: f67b7112775fd9957cc156cc4483e11b8c0c981a
Component: engine
2016-04-08 19:50:18 -05:00
ac13b98614 Merge pull request #21894 from Microsoft/sjw/nanoserver-fix
Fixing warning to correctly output error string.
Upstream-commit: f62b26571a2727b1fabfb7e88cbdbcfa2144a1fa
Component: engine
2016-04-08 16:43:07 -07:00
e1f6a69273 Fixing warning to correctly output error string.
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: 3c220cfcbad901c9366c209e83dc917ee4cf4f0c
Component: engine
2016-04-08 15:04:04 -07:00
2d17cc1e1d Merge pull request #21760 from hqhq/hq_minimum_reservation
Add minimum limit for memory reservation
Upstream-commit: e626011bfb139346570a3b6320c0bad3f6c29b0c
Component: engine
2016-04-08 07:58:28 -07:00
1a5ffe3e32 Fix critical bug: can't restart a restarting container
When user try to restart a restarting container, docker client report
error: "container is already active", and container will be stopped
instead be restarted which is seriously wrong.

What's more critical is that when user try to start this container
again, it will always fail.

This error can also be reproduced with a `docker stop`+`docker start`.

And this commit will fix the bug.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: a705e166cf3bcca62543150c2b3f9bfeae45ecfa
Component: engine
2016-04-08 22:02:30 +08:00
6f10eaf3f8 Merge pull request #21777 from Microsoft/jjh/killTP4
Windows: So long TP4, so long...
Upstream-commit: 7f865e49538a2391d26de795efc0981a6db02127
Component: engine
2016-04-08 09:33:23 -04:00
6e179f4b7d Additional syslog-format option to allow microsecond resolution in syslog timestamp.
This fix tries to add an additional syslog-format of `rfc5424micro` which follows
the same as rfc5424 except that it use microsecond resolution for timestamp. The
purpose is to solve the issue raised in #21793 where log events might lose its
ordering if happens on the same second.

The timestamp field in rfc5424 is derived from rfc3339, though the maximium
resolution is limited to "TIME-SECFRAC" which is 6 (microsecond resolution).

The appropriate documentation (`docs/admin/logging/overview.md`) has been updated
to reflect the change in this fix.

This fix adds a unit test to cover the newly introduced format.

This fix fixes #21793.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Upstream-commit: 7581cf96fbe0cddacf246f2982634190ebe455c9
Component: engine
2016-04-08 05:00:11 +00:00
f61a32826f Merge pull request #21872 from Microsoft/sjw/nanoserver-fix
Fixing nanoserver image load bug.
Upstream-commit: d5ef62f4895206abd4ab2b5e61a49a59d37d1ecf
Component: engine
2016-04-07 21:24:32 -07:00
ab9594eafe Add missing "start" event back for auto-restart container
When container is automatically restarted based on restart policy,
docker events can't get "start" event but only get "die" event, this is
not consistent with previous behavior. This commit will add "start"
event back.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: fdfaaeb9aa72404bde5207510bf5910893414b5d
Component: engine
2016-04-08 11:40:32 +08:00
088a8da7f5 Merge pull request #21774 from Microsoft/jstarks/support_non_base_layered_images
Windows: support non-base-layered images
Upstream-commit: fdd5b5de6290f351a91b80f4e6634fbb87862776
Component: engine
2016-04-07 20:13:38 -07:00
4b530927b7 Fix docker stats missing memory limit
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: a0a6d031d76c1bf9d5581a8310b8a2d1df4b7b82
Component: engine
2016-04-07 22:09:07 -04:00
30ee59a24a Merge pull request #21867 from calavera/remove_reference_from_api
Remove reference package dependency from the api.
Upstream-commit: 681b5e0ed45f535d123d997884ce4ffb2907932f
Component: engine
2016-04-07 21:56:43 -04:00
e3b16ea4f7 Windows: Support ApplyDiff on a base layer
This adds support to the Windows graph driver for ApplyDiff on a base
layer. It also adds support for hard links, which are needed because the
Windows base layers double in size without hard link support.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: cf7944bf6f64c844b74ad937a79d66dafaf99673
Component: engine
2016-04-07 17:52:28 -07:00
cfe0e7d529 Windows: Support non-base-layered images
Previously, Windows only supported running with a OS-managed base image.
With this change, Windows supports normal, Linux-like layered images, too.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: d45a26d7e24719814bc321db6fa173110af30740
Component: engine
2016-04-07 17:52:26 -07:00
048b376d5a Merge pull request #21816 from estesp/case-of-the-missing-else
Don't perform external setkey when net==host
Upstream-commit: fc352287c17cb044dca49b253dee9050748535ad
Component: engine
2016-04-07 17:01:30 -07:00
431366980d Fixing nanoserver image load bug.
Fixes an issue that prevents nano server images from loading properly. Also updates logic for custom image loading to avoid preventing daemon start because an image failed to load.

Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: a22092b13695c44790bb443ac8b536965b1cdba3
Component: engine
2016-04-07 16:44:51 -07:00
956e3c675e Remove reference package dependency from the api.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 47afe6bd0a0dc806c36d0978a8d3e23f75ef87fe
Component: engine
2016-04-07 15:01:23 -07:00
742837d4b6 Merge pull request #21828 from dmcgowan/fix-overlay-on-overlay-test
Fix overlay test running on overlay
Upstream-commit: 2e236d0255bd6f4f5f37c2512f89b22655d47d1f
Component: engine
2016-04-07 10:07:25 +02:00
63950888d2 Merge pull request #21830 from anusha-ragunathan/auplink
Be more lenient on auplink errors.
Upstream-commit: 8785952282a444358e934678b3833be935340259
Component: engine
2016-04-07 09:19:38 +02:00
bab358354a Fix overlay test running on overlay
Overlay tests were failing when /var/tmp was an overlay mount with a misleading message.
Now overlay tests will be skipped when attempting to be run on overlay.
Tests will now use the TMPDIR environment variable instead of only /var/tmp

Fixes #21686

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 824c72f4727504e3a8d37f87ce88733c560d4129
Component: engine
2016-04-06 21:06:42 -07:00
b63495d305 Be more lenient on auplink errors.
On aufs, auplink is run before the Unmount. Irrespective of the
result, we proceed to issue a Unmount syscall. In which case,
demote erros on auplink to warning.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: dbd9b7e121c2e20e5429fdc97421c9510746161e
Component: engine
2016-04-06 18:24:19 -07:00
86db45237f Merge pull request #21733 from Microsoft/sjw/updatepending
Adding postRunProcessing infrastructure for hanlding Windows Update.
Upstream-commit: 9d7f6bb921d7ea9a0954fe0e4e7612742935a540
Component: engine
2016-04-06 15:36:39 -07:00