Commit Graph

583 Commits

Author SHA1 Message Date
22458c8162 Windows: support docker diff
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4fac603682747476a12dba0df79c10e919eddefb
Component: engine
2016-10-28 11:06:54 -07:00
9a299b360f Make experimental a runtime flag
Signed-off-by: Kenfe-Mickael Laventure <mickael.laventure@gmail.com>
Upstream-commit: 7781a1bf0fef748877326632b88e92fbf3c90daa
Component: engine
2016-10-24 15:20:01 -07:00
fe1dce6a91 pkg/archive: remove unnecessary Archive and Reader type
The `archive` package defines aliases for `io.ReadCloser` and
`io.Reader`. These don't seem to provide an benefit other than type
decoration. Per this change, several unnecessary type cases were
removed.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: aa2cc18745cbe0231c33782f0fa764f657e3fb88
Component: engine
2016-10-20 19:31:24 -07:00
8fb804fc58 Fix the typo of URLs
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
Upstream-commit: fa378413f88054d0a336d675e7280930ddc86cb2
Component: engine
2016-10-19 17:46:27 +08:00
ed569140d9 Add limit to page size used by overlay2 driver
Go can falsely report a larger page size than supported,
causing overlay2 mount arguments to be truncated. When overlay2
detects the mount arguments have hit the page limit, it will
switch to using relative paths. If this limit is smaller than
the actual page size there is no behavioral problems, but if it
is larger mounts can fail for images with many layers.

Closes #27384

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 520034e35b463e8c9d69ac78b52a4e5df958bc04
Component: engine
2016-10-18 17:34:19 -07:00
d85a4563ef Merge pull request #27483 from YuPengZTE/devFixLink
Fix the typo of link in devmapper
Upstream-commit: 32156e17584782ab7d08f37ec402c0d17bb2cd92
Component: engine
2016-10-18 12:45:31 -07:00
153b6651a5 Fix the typo of link in devmapper
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
Upstream-commit: f7701d90a94922fa6854cc80b2218392d6a4ac76
Component: engine
2016-10-18 16:02:38 +08:00
2cd33b295f Make golint happy.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: eb4c4b7ecfb06e304139dcffe9ef309c57479211
Component: engine
2016-10-17 17:28:27 -07:00
5d899f98e2 move graphdriver/projectquota.go to its own package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 767727480f2856440cc908be7c9296dccb93346c
Component: engine
2016-10-17 17:27:24 -07:00
c6750abd82 projectquota: fix build failure with new kernels
In kernel version >= v4.5 the project quota ioctl definitions
have been made public via the include/uapi/linux/fs.h API, so
that ext4 could use the same API.

Avoid re-defining the ioctl API if it is already defined in fs.h.

Signed-off-by: Amir Goldstein <amir73il@aquasec.com>
Upstream-commit: 9ea50714469c0c5773178222ae6b745701ac9076
Component: engine
2016-10-17 21:44:23 +03:00
7b84e05ca6 Merge pull request #24771 from aquasecurity/xfs_quota
Implement XFS quota for overlay2
Upstream-commit: 8863a9f62cb16fbdbb318165ffc8140aeb32c597
Component: engine
2016-10-17 09:23:42 -07:00
c040e3fa40 Merge pull request #27334 from darrenstahlmsft/ExpandSandboxSizeZero
Windows: Stop expanding sandbox size when no new size is specified
Upstream-commit: f2c094cb99b20faba0731509ca9ebb4c5e67e9cf
Component: engine
2016-10-14 17:51:32 -07:00
1e912551c1 Merge pull request #27335 from barracks510/master
Simplify function signature
Upstream-commit: 429812f86a7095c19ae48552f6b97150846ca29b
Component: engine
2016-10-13 18:54:01 -07:00
4b9781e130 all: replace loop with single append
Signed-off-by: Elena Morozova <lelenanam@gmail.com>
Upstream-commit: 64238fef8c7b739a2ae5648386cf594eb3a162e5
Component: engine
2016-10-13 13:31:52 -07:00
bec868f66a Simplify function signature
Signed-off-by: Dennis Chen <barracks510@gmail.com>
Upstream-commit: 445620f231ccd2a99e5ebb8fc004dcb254cc2c4b
Component: engine
2016-10-12 21:31:55 -04:00
c622fde306 Stop expanding sandbox size when no new size is specified
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: 0da31c68f11d6e2a795b4e4faf7f969916db5f81
Component: engine
2016-10-12 16:58:57 -07:00
effa6f4094 Update plugingetter import path in docker/docker.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: a98be0344b24d71235c17a87ff425f3d602e48e8
Component: engine
2016-10-11 11:24:18 -07:00
f43049507b Fix naivediffdriver timestamp precision bug
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: d1a83059f700ea7a15a4f17f4ed833f023ec3398
Component: engine
2016-10-07 13:52:17 -07:00
fa6f37076c Merge pull request #26898 from YuPengZTE/devErrorsNew
In error, the first letter is low-case letter
Upstream-commit: c2f57291ac04a1d582d7fcdedda7b1ad707543d5
Component: engine
2016-09-27 10:10:57 -04:00
ebdbeeeb36 In error, the first letter is low-case letter
Signed-off-by: YuPengZTE <yu.peng36@zte.com.cn>
Upstream-commit: 110ab746ba50e9febcdd246671f258036c71e59a
Component: engine
2016-09-27 10:40:07 +08:00
9a2a361f03 Merge pull request #26536 from anusha-ragunathan/aufs_unmount
Add retry logic during aufs unmount.
Upstream-commit: c35ab68665d0fbaa759150e8f13703a2f79b2e75
Component: engine
2016-09-26 13:17:12 -07:00
07eae6add2 Add retry logic during aufs unmount.
Treat EBUSY as a transient error and retry. Also stop ignoring unmount errors.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: 0e539fec331cb9dbc4ef784b55516570b11affe2
Component: engine
2016-09-23 13:15:04 -07:00
5c56a3d561 Windows: Back up files mutated during layer import
The Windows BCD store for the utility VM is mutated during layer import,
which causes failures in docker save. Back up the BCD store and related
log files so that save has access to their original contents.

Fixes #25893.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 9c79b0efc02c6452cb9521faa466dcc118a0e433
Component: engine
2016-09-22 17:44:38 -07:00
d36b90b866 overlayfs added to FsNames
Signed-off-by: Pavol Vargovcik <pallly.vargovcik@gmail.com>
Upstream-commit: fe5c91c388e2cd98720a6804b7c637cb21870933
Component: engine
2016-09-22 14:35:40 +02:00
b3a741308d overlay2: add support for --storage-opt size
Allow passing --storage-opt size=X to docker create/run commands
for the `overlay2` graphriver.

The size option is only available if the backing fs is xfs that is
mounted with the `pquota` mount option.
The user can pass any size less then the backing fs size.

Signed-off-by: Amir Goldstein <amir73il@aquasec.com>
Upstream-commit: 05bac4591a4519fbac9d3724f3b708e882bbad80
Component: engine
2016-09-22 07:03:14 +03:00
51bdfebbec projectquota: utility class for project quota controls
This class implements XFS project quota controls
for setting quota limits on a newly created directory.
It currently supports the legacy XFS specific ioctls.

Using this class, quota limits per container can be set
by directory based storage drivers (e.g. overlay), when
backing storage is XFS mounted with 'pquota' mount option.

TODO: use generic quota control ioctl FS_IOC_FS{GET,SET}XATTR
      for both xfs/ext4 for kernel version >= v4.5

Signed-off-by: Amir Goldstein <amir73il@aquasec.com>
Signed-off-by: albam.c <albam.c@navercorp.com>
Upstream-commit: 52897d1c0923eb8f8fd6099fa413a7fa18a21306
Component: engine
2016-09-22 07:03:08 +03:00
f07146ebf8 Make graphdrivers work with pluginv2.
As part of making graphdrivers support pluginv2, a PluginGetter
interface was necessary for cleaner separation and avoiding import
cycles.

This commit creates a PluginGetter interface and makes pluginStore
implement it. Then the pluginStore object is created in the daemon
(rather than by the plugin manager) and passed to plugin init as
well as to the different subsystems (eg. graphdrivers, volumedrivers).
A side effect of this change was that some code was moved out of
experimental. This is good, since plugin support will be stable soon.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: fefea805e930a67fb6327f8e59415932861358cb
Component: engine
2016-09-20 08:49:48 -07:00
d5426f0e52 Windows: Remove TP5 hack from graphdriver
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f61315f0df480b261a70278360b08f32c991d3ef
Component: engine
2016-09-17 16:16:50 -07:00
b82751259c Merge pull request #26555 from miaoyq/refactor-aufsMount
refactor the function 'aufsMount' in 'daemon/graphdriver/aufs/aufs.go'
Upstream-commit: 354835695730c32a3c2374d2453d3cdf73bf4ee0
Component: engine
2016-09-17 08:04:18 -04:00
92f94b6c20 correct some nits in comments
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: 9279a93f6d43da4c904eeb0adb249fdfa34f7f92
Component: engine
2016-09-15 12:17:58 +08:00
4ffc78810e refactor the function 'aufsMount' in 'daemon/graphdriver/aufs/aufs.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>

update

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: b6a268d91fe3192d71c77c5aac4fddde2e8c864c
Component: engine
2016-09-14 15:42:51 +08:00
467aa61392 Optimized debug print in the 'deviceset.go'
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
Upstream-commit: 664ad19486b55a529ba2ba53b7d432b03dc5384a
Component: engine
2016-09-12 15:34:17 +08:00
30755d9f2c devmapper: Fail to start container if xfs_nospace_max_retries can't be enforced
We just introduced a new tunable dm.xfs_nospace_max_retries. But this tunable
will work only on new kernels where xfs supports this feature. On older
kernels xfs does not allow tuning this behavior.

There are two issues. First one is that if xfsSetNospaceRetries() fails,
it returns error but leaves the device activated and mounted. We should
be unmounting the device and deactivate it before returning.
 
Second issue is, if docker is started on older kernel, with
dm.xfs_nospace_max_retries specified, then docker will silently ignore the
fact that /sys file to tweak this behavior is not present and will continue.
But I think it might be better to fail container creation/start if kernel
does not support this feature.

This patch fixes it. After this patch, user will get an error like following
when container is run.

# docker run -ti fedora bash
docker: Error response from daemon: devmapper: user specified daemon option dm.xfs_nospace_max_retries but it does not seem to be supported on this system :open /sys/fs/xfs/dm-5/error/metadata/ENOSPC/max_retries: no such file or directory.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 6cc55dd65b363fe520c2ab29a9303f79afd4cadb
Component: engine
2016-09-07 14:03:01 -04:00
f9ef0edaad devmapper: Provide a knob dm.xfs_nospace_max_retries
When xfs filesystem is being used on top of thin pool, xfs can get ENOSPC
errors from thin pool when thin pool is full. As of now xfs retries the
IO and keeps on retrying and does not give up. This can result in container
application being stuck for a very long time. In fact I have seen instances
of unkillable processes. So that means once thin pool is full and process
gets stuck, container can't be stopped/killed either and only option left
seems to be power recycle of the box.

In another instance, writer did not block but failed after a while. But
when I tried to exit/stop the container, unmounting xfs hanged and only
thing I could do was power cycle the machine.

Now upstream kernel has committed patches where it allows user space to
customize user space behavior in case of errors. One of the knobs is
max_retries, which specifies how many times an IO should be retried
when ENOSPC is encountered.

This patch sets provides a tunable knob (dm.xfs_nospace_max_retries) so
that user can specify value for max_retries and tune xfs behavior. If
one sets this value to 0, xfs will not retry IO when ENOSPC error is
encountered. It will instead give up and shutdown filesystem.

This knob can be useful if one is running into unkillable
processes/containers issue on top of xfs.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 4f0017b9ad7dfa2e9dcdee69d000b98595893e60
Component: engine
2016-09-01 11:38:09 -04:00
670946bf76 Avoid fork on mount for overlay2 in common case
In the common case where the user is using /var/lib/docker and
an image with less than 60 layers, forking is not needed. Calculate
whether absolute paths can be used and avoid forking to mount in
those cases.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c13a985fa1196a5ed782d5ac68a4bbb68dd529ca
Component: engine
2016-08-22 11:43:10 -07:00
0f2f3d0378 Merge pull request #25746 from lixiaobing10051267/masterName
wrong id when testing exists in daemon aufs
Upstream-commit: d7753dceb814e92c20a067df51fd231fe2d0fda9
Component: engine
2016-08-16 13:00:03 -04:00
060a7d7824 wrong id when testing exists in daemon aufs
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: cdb6c59eda4e78d626721a6a38fd305a6d2c50f3
Component: engine
2016-08-16 16:42:45 +08: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
1dbc55e6ff Merge pull request #25509 from Microsoft/jjh/23079
Windows: Block ReFS file systems
Upstream-commit: 34cc19f6702c23b2ae4aad2b169ca64154404f9f
Component: engine
2016-08-12 09:32:22 -07:00
fe7b1d72f0 Merge pull request #23391 from Microsoft/WindowsSandboxSize
Windows: Added support for storage-opt size
Upstream-commit: 04e021d7511fcfdc0838a0165f70a4772c0e7718
Component: engine
2016-08-09 15:34:39 +02:00
a4fc4e13d8 Windows: Block ReFS file systems
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 1cb9e9b44e7140d14dd42d48b2a7c038b65e8f16
Component: engine
2016-08-08 14:30:37 -07: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
658a5f6d39 use %s instead of %q when format in graphdirver log
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: dec4481e08179bb9fa9ae5adc5b8aa14f2fb5087
Component: engine
2016-07-30 02:12:55 +08: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
8ab2988832 Update diff apply test to check sub directories
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 5c05b8447d06793530e3d860b99a6e878685275a
Component: engine
2016-07-26 12:03:55 -07:00
7804833e8f Merge pull request #24997 from WeiZhang555/fix-unmeaningful-log
small nit: fix unmeaningful log
Upstream-commit: 19ec73b8b5e08d24edcd0eb886fa514d2678741a
Component: engine
2016-07-25 10:33:57 -04:00
5d53107934 small nit: fix unmeaningful log
Truncated dir name can't give any useful information, print whole dir
name will.

Bad debug log is like this:

```
DEBU[2449] aufs error unmounting /var/lib/doc: no such file or directory
```

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: af8359562c9561afad0a05e66386588d17788804
Component: engine
2016-07-26 07:10:28 +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
ae77cef214 Create zfs directory if it doesn't exist at startup.
Signed-off-by: Damian Smyth <damian@dsau.co>
Upstream-commit: 205bc6fc99872ba852fa7a158c106514d5b64179
Component: engine
2016-07-19 10:12:22 +10: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