Commit Graph

593 Commits

Author SHA1 Message Date
6fb90ed484 Add functional support for Docker sub commands on Solaris
Signed-off-by: Amit Krishnan <krish.amit@gmail.com>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 934328d8ea650bf8a9c3c719999ce2a1f5dd5df6
Component: engine
2016-11-07 09:06:34 -08:00
fb8fd8dbba Merge pull request #28006 from dmcgowan/clean-overlay2-layerstore
Cleanup invalid code in overlay2 and layer store
Upstream-commit: 1f4137857f6eb8edcbefe591e1abe04d83da3416
Component: engine
2016-11-02 23:16:38 -07:00
184a08cc1e Merge pull request #27963 from darrenstahlmsft/RenameDelete
Windows: Rename layers before deletion
Upstream-commit: cb352501af9e59f10f58846d4154c76726530753
Component: engine
2016-11-02 19:20:39 -07:00
94f5e97be8 Cleanup invalid code in overlay2 and layer store
The overlay2 change ensures that the correct path is used to resolve the
symlink. The current code will not fail since the symlinks are always given
a value of "../id/diff" which ends up ignoring the incorrect "link" value.
Fix this code so it doesn't cause unexpected errors in the future if the
symlink changes.

The layerstore cleanup ensures that the empty layer returns a tar stream if
the provided parent is empty. Any value other than empty still returns an
error since the empty layer has no parent. Currently empty layer is not
used anywhere that TarStreamFrom is used but could break in the future if
this function is called.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 6622cc970e27a7bf2798d751ed276265a3a2d404
Component: engine
2016-11-02 16:13:53 -07:00
0e01981fe9 Merge pull request #27932 from thaJeztah/promote-overlay
promote overlay(2) graphdriver
Upstream-commit: 78a83a22699198b31c8cbdace3a73c8502f99ba1
Component: engine
2016-11-02 07:00:49 -07:00
b8d232c6a7 Windows: Rename layers before deletion
Signed-off-by: Darren Stahl <darst@microsoft.com>
Upstream-commit: be68006d1928b34936050175e67f85b4ee7f67cf
Component: engine
2016-11-01 18:05:09 -07:00
9e9fd11160 Merge pull request #22641 from cpuguy83/build_finalization
Adds ability to flatten image after build
Upstream-commit: 22f3e43e9a35711bb63108f1714840a92a4b138e
Component: engine
2016-11-01 14:30:18 -07:00
c7c95dc226 Adds ability to squash image after build
Allow built images to be squash to scratch.
Squashing does not destroy any images or layers, and preserves the
build cache.

Introduce a new CLI argument --squash to docker build
Introduce a new param to the build API endpoint `squash`

Once the build is complete, docker creates a new image loading the diffs
from each layer into a single new layer and references all the parent's
layers.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 362369b4bbea38881402d281ee2015d16e8b10ce
Component: engine
2016-11-01 13:41:59 -04:00
a691b85705 promote overlay(2) graphdriver
Now that overlay has matured, using
overlay is a better choice than devicemapper
on loopback devices.

This change promotes overlay in the
priority list. It also adds the
overlay2 graphdriver to the list
because overlay2 (if supported)
should be preferred over overlay.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 299beff1c4e2406d1e96c90a9e86e0770dd4342d
Component: engine
2016-10-31 23:32:10 -07:00
07a831dfc2 Fix logrus formatting
This fix tries to fix logrus formatting by removing `f` from
`logrus.[Error|Warn|Debug|Fatal|Panic|Info]f` when formatting string
is not present.

Fixed issue #23459

Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
Upstream-commit: fa710e504b0e3e51d4031790c18621b02dcd2600
Component: engine
2016-10-31 22:05:01 -06:00
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