Commit Graph

297 Commits

Author SHA1 Message Date
385c38be8c Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage
Upstream-commit: 8d2739df980a1af76ad50e5c423134815186b61c
Component: engine
2015-07-30 22:40:57 -04:00
bdce5e6b99 fix unit test breakage due to lint changes
Addresses #14756

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 22873eae3153f93b55b3b09eff887a3bfdc8eb54
Component: engine
2015-07-31 00:22:28 +00:00
3c8e934faf Simplify and fix os.MkdirAll() usage
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.

Quoting MkdirAll documentation:

> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.

This means two things:

1. If a directory to be created already exists, no error is returned.

2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.

The above is a theory, based on quoted documentation and my UNIX
knowledge.

3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.

Because of #1, IsExist check after MkdirAll is not needed.

Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.

Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.

[v2: a separate aufs commit is merged into this one]

[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Upstream-commit: a83a76934787a20e96389d33bd56a09369f9b808
Component: engine
2015-07-30 11:48:08 -07:00
197e6f60b8 Merge pull request #15040 from vbatts/vbatts-double-decompress-fix
archive, graphdriver: double decompress fix
Upstream-commit: 8724e8953d446ade61856d4944126ffccb2aead9
Component: engine
2015-07-29 16:48:02 -07:00
4cd45101c0 Merge pull request #13542 from kvasdopil/freebsd-work
Make docker build on FreeBSD
Upstream-commit: 75f8bdd970e5355a6238e7b41a9f1aee9cd3f890
Component: engine
2015-07-29 15:15:37 -07:00
abf825af14 Merge pull request #15111 from Microsoft/fix-archive-copy-log
Fix log to logrus
Upstream-commit: c09c497c71e3fbcec6fee6ee0f4eb5097fc1b4b7
Component: engine
2015-07-29 14:48:19 -04:00
59df5a01ec make docker compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 26c03d561ab126287bb3034cc23477d18869a888
Component: engine
2015-07-29 21:25:56 +03:00
a7dc60d0d3 Fix log to logrus
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2bf73c4b1a3b195ee426e74d221a9df032aaa89e
Component: engine
2015-07-29 09:58:07 -07:00
581a7026d5 daemon/graphdriver/devmapper/ fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 972a94b449ea6a68f041c47fe7bda35b5ac765a2
Component: engine
2015-07-29 01:43:34 +00:00
79954e9a3c graphdriver/*: expect uncompressed tar for ApplyDiff
The `ApplyDiff` function takes a tar archive stream that is
automagically decompressed later. This was causing a double
decompression, and when the layer was empty, that causes an early EOF.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 273f50c741e82a0be3e9f9d4c975cc18801dfe38
Component: engine
2015-07-28 16:36:39 -04:00
fb177a237a Merge pull request #14863 from brahmaroutu/lint_daemon_graphdriver_aufs
daemon/graphdriver/aufs fix lint errors/warnings
Upstream-commit: e06df594f5a449572d6807788f30a0240048b6a2
Component: engine
2015-07-28 11:46:40 -07:00
7f7157de05 daemon/graphdriver/aufs fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 55885daa56a0278ed5b412497b3bf99f52d6c52e
Component: engine
2015-07-28 06:17:05 +00:00
39dd67d7c5 daemon/graphdriver/graphtest/ fix lint errors/warnings
Addresses #14756

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 12460f41a462b441d40db1a70165f7854f3fb77a
Component: engine
2015-07-28 06:01:00 +00:00
b123b9f21b Fix typo in overlay's create godoc.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 5bac5302e59f0759545910ef748cc9a6f87db5c5
Component: engine
2015-07-27 15:37:26 -07:00
7e7519f5f0 Merge pull request #14875 from brahmaroutu/lint_daemon_graphdriver_btrfs
daemon/graphdriver/btrfs fix lint errors/warnings
Upstream-commit: 303345dc6a5179684bfe5f78ad9b3d73aba93d0e
Component: engine
2015-07-27 10:28:50 -07:00
Lei
26ba48c09d Add VxFS magic number, fixes #14847
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: e1c5e9b5610e46bf9526dafcbfba3332fe1983e0
Component: engine
2015-07-24 16:37:56 +08:00
ef42dd327d daemon/graphdriver/btrfs fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 17c19f395f4d88c70f33119e01a077ca1fdb5c1d
Component: engine
2015-07-23 22:48:45 +00:00
18f721f868 ZFS driver: raise better errors during init
The ZFS driver should raise proper errors when the ZFS utility is
missing or when there's no zfs partition active on the system. Raising the
proper errors make possible to silently ignore the ZFS storage
driver when no default storage driver is specified.

Previous to this commit it was no longer possible to start the
docker daemon in that way:

  docker -d --storage-opt dm.loopdatasize=2GB

The above command resulted in an exit error because the ZFS driver
tried to use the storage options.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Upstream-commit: f95b3a6b6a4d86c6373e24b83ba1a008bf107265
Component: engine
2015-07-20 15:24:48 +02:00
8a425b30fb Merge pull request #14693 from LK4D4/update_libcontainer
Update libcontainer
Upstream-commit: 98ed9a55f42f7c86c7c9cddb27f6807e7e77c889
Component: engine
2015-07-17 13:02:04 -07:00
5fc55316cd devicemapper: Change default basesize to 100G
Current default basesize is 10G. Change it to 100G. Reason being that for
some people 10G is turning out to be too small and we don't have capabilities
to grow it dyamically.

This is just overcommitting and no real space is allocated till container
actually writes data. And this is no different then fs based graphdrivers
where virtual size of a container root is unlimited.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 424d5e55a2f863b8eadab578e3ba647de09a4354
Component: engine
2015-07-17 11:10:23 -04:00
d9e652a366 Update libcontainer
Replaced github.com/docker/libcontainer with
github.com/opencontainers/runc/libcontaier.
Also I moved AppArmor profile generation to docker.

Main idea of this update is to fix mounting cgroups inside containers.
After updating docker on CI we can even remove dind.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c86189d554ba14aa04b6314970d3699e5ddbf4de
Component: engine
2015-07-16 16:02:26 -07:00
46a0415407 Fix some formatting calls
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a5142f6ac31c6c21b96c6895fff525c46e8056a6
Component: engine
2015-07-15 12:25:50 -07:00
a1ee4d8815 Merge pull request #14021 from rhvgoyal/detect-pool-loopback-devices
devicemapper: Check loop devices of existing pool
Upstream-commit: 5ca3e7c54c9140f2b8553060fdd75d3986e6db6e
Component: engine
2015-07-13 21:15:23 -04:00
1296feade8 Windows: Graph driver implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 52f4d09ffb376ffaa6677cb1e0413c6a97f53f24
Component: engine
2015-07-10 14:33:11 -07:00
a095147db9 Fix panic on devicemapper initialization
The ability to save and verify base device UUID (#13896) introduced a
situation where the initialization would panic when removing the device
returns EBUSY.

Functions `verifyBaseDeviceUUID` and `saveBaseDeviceUUID` now take the
lock on the `DeviceSet`, which solves the problem as `removeDevice`
assumes it owns the lock.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: f08989902374a517b1f8e5e0bfd3b4ea59e5ba27
Component: engine
2015-07-08 09:10:20 -07:00
78101e16cc Merge pull request #14100 from rhvgoyal/overlay-docker-inspect
overlay: Export metadata for container and image in docker-inspect
Upstream-commit: 2fe51ecee75801b6a937801ccd2839335a3f8c88
Component: engine
2015-07-07 18:11:27 -07:00
682ea83bb3 Warn when udev_sync is not supported.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: e27131519f610178fd8adfc4b87c7bc2521a562f
Component: engine
2015-07-07 15:10:24 -06:00
c17c7fce57 Revert "Fix implicit DeviceMapper selection"
This reverts commit 0a376291b2213699f986a7bca1cc8c4f4ed00f8d.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 9af7afb9eb138bdba33c22445f36f41e5aa26bd1
Component: engine
2015-07-07 12:27:19 -07:00
5ce830016b devicemapper: Check loop devices of existing pool
Often it happens that docker is not able to shutdown/remove the thin
pool it created because some device has leaked into some mount name
space. That means device is in use and that means pool can't be removed.

Docker will leave pool as it is and exit. Later when user starts the
docker, it finds pool is already there and docker uses it. But docker
does not know it is same pool which is using the loop devices. Now
docker thinks loop devices are not being used. That means it does not
display the data correctly in "docker info", giving user wrong information.

This patch tries to detect if loop devices as created by docker are
being used for pool and fills in the right details in "docker info".

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: bebf53443981c70a6a714ea518dc966a0e2b6558
Component: engine
2015-07-07 14:13:29 -04:00
740b021c6a Fix implicit DeviceMapper selection
DeviceMapper must be explicitly selected because the Docker binary might not be linked to the right devmapper library.

With this change, Docker fails fast if the driver detection finds the devicemapper directory but the driver is not the default option.
The option `override_udev_sync_check` doesn't make sense anymore, since the user must be explicit to select devicemapper, so it's being removed.
Docker fails to use devicemapper only if Docker has been built statically unless the option was explicit.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 0a376291b2213699f986a7bca1cc8c4f4ed00f8d
Component: engine
2015-07-02 09:21:27 -07:00
4f74d3f3bd Closes #13323 and carries
Entering comments

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: 078b23a37daf95101bf31bafc7f8396af7ad7d98
Component: engine
2015-06-29 06:18:41 -07:00
c5288d75d1 overlay: Export metadata for container and image in docker-inspect
Export metadata for container and image in docker-inspect when overlay
graphdriver is in use. Right now it is done only for devicemapper graph
driver.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 67473c6d06f084f58467ef257e2de4b2c0161240
Component: engine
2015-06-25 17:33:20 -04:00
94d7dd0cf8 Merge pull request #13896 from rhvgoyal/verify-base-uuid
devicemapper: Compare uuid of base device on startup
Upstream-commit: 85d3b75dfddde62bf1c934afd1cd41ee12309223
Component: engine
2015-06-17 11:30:04 -07:00
f21492c649 devicemapper: Compare uuid of base device on startup
It is easy for one to use docker for a while, shut it down and restart
docker with different set of storage options for device mapper driver
which will effectively change the thin pool. That means any of the
metadata stored in /var/lib/docker/devicemapper/metadata/ is not valid
for the new pool and user will run into various kind of issues like
container not found in the pool etc.

Users think that their images or containers are lost but it might just
be the case of configuration issue. People might use wrong metadata
with wrong pool.

To detect such situations, save UUID of base image and once docker
starts later, query and compare the UUID of base image with the
stored one. If they don't match, fail the initialization with the
error that UUID failed to match.

That way user will be forced to cleanup /var/lib/docker/ directory
and start docker again.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: c06b05b11e6bbe48ae3ca140096d7862e5e312f8
Component: engine
2015-06-16 21:12:27 -04:00
8810db85be Merge pull request #13198 from rhvgoyal/extend-docker-inspect
docker-inspect: Extend docker inspect to export image metadata related to graph driver
Upstream-commit: e69df2589c1220217054abdc6a361b55990b3c0b
Component: engine
2015-06-16 15:03:14 -05:00
1868142b6e Fix circular import for windows vfs graphdriver
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 49834e8d5922f8c256124177b188d89007af03f6
Component: engine
2015-06-16 09:08:10 -04:00
bc9e6b9254 Windows - Really fix VFS this time
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 59cfc089820f6f8a2a5f24ddfcf0fe1328c9568c
Component: engine
2015-06-15 15:09:48 -07:00
4a6f8e2e63 docker-inspect: Extend docker inspect to export image/container metadata related to graph driver
Export image/container metadata stored in graph driver. Right now 3 fields
DeviceId, DeviceSize and DeviceName are being exported from devicemapper.
Other graph drivers can export fields as they see fit.

This data can be used to mount the thin device outside of docker and tools
can look into image/container and do some kind of inspection.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 407a626be62996cd6385ea4d80e669ab83f5f04d
Component: engine
2015-06-15 14:05:10 -04:00
57eb64c9c0 Carry of PR #13520
Removinig files

Signed-off-by: Mary Anthony <mary@docker.com>
Upstream-commit: cd44018856be421497a35d96f88dd0eec42fae43
Component: engine
2015-06-13 09:27:30 -07:00
06662e40d0 Merge pull request #13494 from Microsoft/10662-vfsdriveroption
Windows: Allow VFS
Upstream-commit: e7533d7f81fdb3d33efd91c751d25b9d3b80f4e1
Component: engine
2015-06-12 11:12:32 -07:00
01cbc209ac Windows: Allow VFS
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e89f837bc6a26e08e02f25b6e474d4ad7bdfb101
Component: engine
2015-06-12 09:21:17 -07:00
9a58c12eeb zfs: correctly apply selinux context
fixes #13858

Signed-off-by: Jörg Thalheim <joerg@higgsboson.tk>
Upstream-commit: 19c31a703fb84f1079cc2466d435cb4913a4bfd2
Component: engine
2015-06-11 11:11:37 +02:00
6c4935d15a Merge pull request #13832 from mapk0y/fix-error-msg
fix typo.
Upstream-commit: add64dc297a4549e1abe0e0c5176eeabd198fb47
Component: engine
2015-06-10 16:38:07 -04:00
8e654cb58d fix typo.
Signed-off-by: mapk0y <mapk0y@gmail.com>
Upstream-commit: 416e855e9b33464c81e86ff47ed19c93a781e604
Component: engine
2015-06-10 06:26:07 +09:00
bd6a18d14c Windows: Don't build Linux graph drivers
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9a9dc5ba96d2661f5dc2037db44d0984d2129946
Component: engine
2015-06-08 15:09:33 -07:00
fe89ed5cd6 avoid 88-chars mountpoint length limit on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 112b7e654691caa2b5ec283d70cf36245dfab365
Component: engine
2015-05-29 16:33:04 +03:00
ffcd5b22b0 zfs magicnumber check on freebsd is fixed
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 36bf6e44402bc6a0fbf169a73579e47e3f97f1a3
Component: engine
2015-05-28 18:38:08 +03:00
e6982a9c9b Windows: graphdriver refactor
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 4e8b2509fd60bf1ab771db618301650b988b549b
Component: engine
2015-05-20 08:51:27 -07:00
8911352f54 Fix Put without Get in overlay
It is called for example on daemon start after crash

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 3916561619d45a3d8ca17dfa467149824111023a
Component: engine
2015-05-19 09:32:23 -07:00
edeb4ed190 Merge pull request #13249 from coolljt0725/fix_incorrect_document_of_storage_opt
Fix incorrect document storage-opt
Upstream-commit: 70e9e4bf9f7901137483fb4c9635d8d3cf686328
Component: engine
2015-05-18 11:35:01 -07:00