Commit Graph

2056 Commits

Author SHA1 Message Date
4467c80b95 Use real chroot if daemon is running in a user namespace
The namespace unshare+pivot root is not possible when running inside a
user namespace, so fallback to the original "real" chroot code.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: dc950567c105153c0a2f8b40d16b989bbddcdb3c
Component: engine
2016-08-12 16:31:01 -04:00
cc5b6aa3dd Don't create devices if in a user namespace
If we are running in a user namespace, don't try to mknod as
it won't be allowed.  libcontainer will bind-mount the host's
devices over files in the container anyway, so it's not needed.

The chrootarchive package does a chroot (without mounting /proc) before
its work, so we cannot check /proc/self/uid_map when we need to.  So
compute it in advance and pass it along with the tar options.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Upstream-commit: 617c352e9225b1d598e893aa5f89a8863808e4f2
Component: engine
2016-08-12 16:26:58 -04:00
cde4831d1f Merge pull request #24717 from icaoweiwei/patch_2016-07-16_1
Add output of integer argument
Upstream-commit: 2c50035f93ec580fb1b901a2c99a2f95f525a796
Component: engine
2016-08-12 10:54:01 -07:00
8e29f88e6f Merge pull request #25568 from thaJeztah/enhance-string-truncate
Implement stringutils.Ellipsis()
Upstream-commit: 64f83cee43c6fc0785e2beeacc6432572130714b
Component: engine
2016-08-12 17:19:50 +02:00
2e55ebe213 Merge pull request #25561 from allencloud/make-more-pkgs-support-darwin
make more pkgs support darwin
Upstream-commit: 3011a41d3f3b525574407493696ea2391ecc0ff6
Component: engine
2016-08-11 14:17:57 -07:00
60e441e430 Implement stringutils.Ellipsis()
This patch implements an Ellipsis utility to
append an ellipsis (...)  when truncating
strings in output.

It also fixes the existing Truncate() utility
to be compatible with unicode/multibyte characters.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 51dc35cf23a5418e93128854bedc2e59d8ca743a
Component: engine
2016-08-11 14:14:06 +02:00
cb1c855c27 Merge pull request #23951 from allencloud/defer-os-file-close
add defer file.Close to avoid potential fd leak
Upstream-commit: 64605d709f9bf5677d513d6ed78d63fffadc697d
Component: engine
2016-08-10 11:07:15 -07:00
ba822f35dd make more pkgs support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: bd11a269bc114334cf6160ba38e396f8f0e3aecd
Component: engine
2016-08-10 22:56:05 +08:00
1c502571ef add defer file.Close to avoid potential fd leak
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 0ead624473b6bddc232b46bc7c76ab4f9c743ff5
Component: engine
2016-08-10 08:36:09 +08:00
b9dc82dd29 Merge pull request #25415 from avaid96/exitret
added functionality to interrupt the terminal when it is waiting for …
Upstream-commit: 91853e44aeb20e55bcfcad5041c274783fdc06bc
Component: engine
2016-08-09 16:47:54 +02:00
44fa57fb1b Merge pull request #22770 from twistlock/22729_dynamic_authz_reload
Enable to dynamically reload authorization plugins via daemon.config
Upstream-commit: b2b3cb7be92b97150c9be96c606c0ab0a383d2ec
Component: engine
2016-08-05 19:38:40 +02:00
a8be04ca52 added functionality to interrupt the terminal when it is waiting for an input
Signed-off-by: Avi Vaid <avaid1996@gmail.com>
Upstream-commit: c4b07f468388af6483913762d6ce6ae2ac9edf97
Component: engine
2016-08-04 10:00:02 -07:00
e730a09366 Merge pull request #23497 from shishir-a412ed/dm_task_run_failed
Fixes Issue # 23418: Race condition between device deferred removal and resume device.
Upstream-commit: 87e48ecd048c0b083fe09fb8d74c83364abd41e6
Component: engine
2016-08-03 21:54:33 +02:00
6d26e235fc Merge pull request #25105 from hqhq/fix_kmem_test
Fix TestUpdateKernelMemoryUninitialized on new kernel version
Upstream-commit: b47df1ddbe847bdffccb76239e3288d59b69cb3b
Component: engine
2016-08-02 17:15:53 +02:00
1e0e8f732e Fixes Issue # 23418: Race condition between device deferred removal and resume device.
Problem Description:

An example scenario that involves deferred removal
1. A new base image gets created (e.g. 'docker load -i'). The base device is activated and
mounted at some point in time during image creation.
2. While image creation is in progress, a privileged container is started
from another image and the host's mount name space is shared with this
container ('docker run --privileged -v /:/host').
3. Image creation completes and the base device gets unmounted. However,
as the privileged container still holds a reference on the base image
mount point, the base device cannot be removed right away. So it gets
flagged for deferred removal.
4. Next, the privileged container terminates and thus its reference to the
base image mount point gets released. The base device (which is flagged
for deferred removal) may now be cleaned up by the device-mapper. This
opens up an opportunity for a race between a 'kworker' thread (executing
the do_deferred_remove() function) and the Docker daemon (executing the
CreateSnapDevice() function).

This PR cancel the deferred removal, if the device is marked for it. And reschedule the
deferred removal later after the device is resumed successfully.

Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 0e633ee14aca32480ac4735675222c35f4e11d8c
Component: engine
2016-08-02 10:33:58 -04:00
5ef37313b9 Fix TestUpdateKernelMemoryUninitialized on new kernel version
Fixes: #25073

Update kernel memory on running containers without initialized
is forbidden only on kernel version older than 4.6.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: da5d66fb70064b093f73cc31eddb7e8285048161
Component: engine
2016-08-02 13:17:20 +08:00
5bb33260e8 Revert "Add checking err for IsWindowsClient()"
Signed-off-by: Stefan J. Wernli <swernli@microsoft.com>
Upstream-commit: d0b9c33f71f1e87e2236f1f9894ce28827791a7a
Component: engine
2016-08-01 17:33:41 -07:00
f1f1cf0467 Merge pull request #25294 from klinden/patch-1
adding entry for Hugh Beaver
Upstream-commit: f2fb28cbb3f32b6ffec209dd4452b126f769f2ef
Component: engine
2016-08-02 01:01:13 +02:00
d1166d12d4 Add entries for Hugh Beaver, Lois Haibt and some more adjectives
Signed-off-by: Kyle Linden <kyle.linden@appliedis.com>
Upstream-commit: 653d083c1e887617f87d89a128d1398b90e0dd50
Component: engine
2016-08-01 16:05:27 -04:00
25dfa2b9fa Merge pull request #24821 from thaJeztah/stringid-refactor
Minor refactor and beter coverage for pkg/stringid
Upstream-commit: d2eb5dc9e0365ea4d50076011a7ef92d435b5032
Component: engine
2016-08-01 21:12:14 +02:00
c8468e1fc2 make pkg pidfile support darwin
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: a91f59d4873e9866928261ad62ebcea3ef7add5f
Component: engine
2016-08-01 22:01:20 +08:00
e8a4996d93 Merge pull request #25066 from lixiaobing10051267/masterErr
Add checking err for IsWindowsClient()
Upstream-commit: 4554e6065100d493dd9cd2935901b8532a0dc504
Component: engine
2016-07-30 17:25:08 +01:00
565fab494f Enable to dynamically reload authorization plugins via daemon.config
Following #22729, enable to dynamically reload/remove the daemon
authorization plugins (via standard reloading mechanism).
https://docs.docker.com/engine/reference/commandline/daemon/#daemon-
configuration-file

Daemon must store a reference to the authorization middleware to refresh
the plugin on configuration changes.

Signed-off-by: Liron Levin <liron@twistlock.com>
Upstream-commit: 4192fe9c06d150fadfe18f228a6f9c3875227b8a
Component: engine
2016-07-30 14:59:07 +03:00
74764063d5 Merge pull request #24081 from Microsoft/jjh/signaltofile
Windows: Stack dump to file
Upstream-commit: 1e6fd0378b431425180bad9fe2c38b296c1bc5bf
Component: engine
2016-07-29 22:09:35 +02:00
488d786bb3 Merge pull request #24745 from daehyeok/logrus
Refactoring for logrus formatting
Upstream-commit: 170abb5f7cabf4921a378d76532e74a272fbe39c
Component: engine
2016-07-28 16:50:19 -07:00
e9800c4e43 Modify func name from TestChtimes to TestChtimesLinux
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>

Modify func note

Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 1df9f0932e50ae497a6c79fc3a0ee85cb67f60d4
Component: engine
2016-07-27 10:05:59 +08:00
0a12b515a3 Merge pull request #25086 from dmcgowan/overlay2-fix-sub-directory-whiteouts
Fix overlay2 sub directory whiteouts
Upstream-commit: bb27d017f395d5683d0f82a203038c3055be91d8
Component: engine
2016-07-26 20:45:41 -04:00
5b655758f7 Fix files in subdirectories creating bad whiteout
Closes #23863

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 1c0f6653ba82c933885719478e90c13f8d7e32b7
Component: engine
2016-07-26 12:03:55 -07:00
a35fb01dfe add to check err
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: b4833e3b3d683242c016e64d8de7385fcb4c8932
Component: engine
2016-07-26 21:43:32 +08:00
ac18bf29a1 Fix pkg/plugins TLSConfig panic
Fix #25046

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Upstream-commit: b1e71bdd1d624e297509a62b072082524dc841fc
Component: engine
2016-07-26 08:53:54 +00:00
b6548fce21 Merge pull request #24961 from jstarks/vt_th2_fix
Windows: Restore console mode on set mode failure
Upstream-commit: bff9a0556f785b094b55fcc9c1e5f83cf74a9aaa
Component: engine
2016-07-25 09:49:34 +02:00
d204454a26 Merge pull request #24977 from lixiaobing10051267/masterNote
Modify several fun notes in fsnotify.go
Upstream-commit: 1f3b400d3c92657a915610a3702cdf4012beffbd
Component: engine
2016-07-25 09:41:17 +02:00
8e3d8789cb Merge pull request #24963 from allencloud/fix-typos
fix typos
Upstream-commit: 40044cb18fd4ff0ed13d8cdd41ec4dcecdac0703
Component: engine
2016-07-25 09:39:48 +02:00
17ffda94c4 Modify several fun notes in fsnotify.go
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: ff2c898652de37f70cd2774a208e61b112d06e1b
Component: engine
2016-07-24 13:35:33 +08:00
7ce557c2bc Func name wrong in notes of response.go
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: d6556a6ef716387122574e37cce4f009b1e21c25
Component: engine
2016-07-23 16:03:27 +08:00
1c3431e16a fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 4e959ef2f7f063803d04e06166f459257eb94b5c
Component: engine
2016-07-23 11:32:23 +08:00
aaeaca1829 Windows: Restore console mode on set mode failure
SetConsoleMode() on input handles appears to remember invalid bits that
were set, causing problems for other programs (such as xcopy.exe) trying
to set the console mode after docker.exe has exited. Always restore
the input console mode on set failure.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 83c186fdd4332b8a08db715e8cb5dd1e80a56567
Component: engine
2016-07-22 18:34:15 -07:00
4a9015ab13 Windows: Stack dump to file
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: b63c92bf241f410b0bda46b42b26f2f86b394c56
Component: engine
2016-07-21 20:04:47 -07:00
9afdf020b7 Minor refactor and beter coverage for pkg/stringid
This slightly simplifies TruncateID() by only
trimming the string if needed.

Also improved unit-tests for this package;

- Add a test for GenerateNonCryptoID()
- Add a test for shortening a sha-256 ID
- Make TestShortenId() more "unit", by using a fixed string, instead of calling GenerateRandomID()

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 78eab14d0b2128ffaff2b3c0cd32c5339ef35ad7
Component: engine
2016-07-20 00:23:06 +02:00
766219b46e Merge pull request #24776 from anusha-ragunathan/plugins-connect
Add only legacy plugins to the legacy lookup map.
Upstream-commit: 6875f71d7c6a01b918fcc372ac2c17c5a0d65418
Component: engine
2016-07-19 17:11:50 +02:00
7f898cc8b4 Use const http status code instead of just numbers see #24783
Signed-off-by: Doron Podoleanu <doronp@il.ibm.com>
Upstream-commit: 6bec735c91c378e1c9cde1744e7c8aca7397104a
Component: engine
2016-07-19 10:40:20 +03:00
7078c249a4 Merge pull request #23878 from jstarks/fix_windows_console
Windows: Always enable VT emulation
Upstream-commit: e6a97db2c932a2b80180c10f2896d7594108a406
Component: engine
2016-07-18 16:23:04 -07:00
0228458e3c Add only legacy plugins to the legacy lookup map.
Legacy plugin model maintained a map of plugins. This is
not used by the new model. Using this map in the new model
causes incorrect lookup of plugins. This change uses adds
a plugin to the map only if its legacy.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 8fd779dc28a11d8727d76e9553379b0c854f7c4c
Component: engine
2016-07-18 15:43:44 -07:00
d3ae6c280d Refactoring for logrus formatting
Use module name logrus instead of log.
Use logrus.[Error|Warn|Debug|Fatal|Panic|Info]f instead of w/o f

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: 6a1183b3ae512961f41a8ccfc8205e08294216f4
Component: engine
2016-07-18 12:53:34 -06:00
a878f5d7fb Merge pull request #24714 from allencloud/better-docker-network-create-help-output
better command `docker network create -h` output
Upstream-commit: 98a4b3e332b908d5be6f59a0612b597653ccdee0
Component: engine
2016-07-18 16:05:46 +00:00
8db8376b96 Fix a wrong word in comment.
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
Upstream-commit: 9be8bf019419be76e9582188888b80b0940abf74
Component: engine
2016-07-17 13:08:07 +08:00
c1bbe8252f Fix a syntax error in comments
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
Upstream-commit: 3fc9a9ccb8ec8783bfcc02b7e4dfd7ee6468fa86
Component: engine
2016-07-16 22:41:04 +08:00
9a28086e41 Add output of integer argument
Signed-off-by: Cao Weiwei <cao.weiwei30@zte.com.cn>
Upstream-commit: 627839072c7f52a9fa4fe4e26f3e43a74481f998
Component: engine
2016-07-16 20:20:00 +08:00
cd03aec1cb better command docker network create -h output
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: d0081a0f476f91b0dc6b28c480e7c95c06b05ebb
Component: engine
2016-07-16 15:32:17 +08:00
04c06a5318 return err when stack name does not exist
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 416613f2e54581c62d3efa1c4f0288b6e7d58365
Component: engine
2016-07-12 00:59:30 +08:00