Commit Graph

410 Commits

Author SHA1 Message Date
6c383a05bb Fix btrfs subvolume snapshot dir perms for user namespaces
Make sure btrfs mounted subvolumes are owned properly when a remapped
root exists (user namespaces are enabled, for example)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 72e65e87935e5b82de76a6ef9b8160900f4724b7
Component: engine
2016-01-07 23:05:28 -05:00
07c9d25d11 Merge pull request #19093 from estesp/userns-root-rework
Allow root non-userns metadata backwards compatibility
Upstream-commit: fe550a1f17f9ef65e03db65241378d8f89ef4525
Component: engine
2016-01-06 09:48:37 -08:00
647bd6865a Allow root non-userns metadata backwards compatibility
Instead of creating a "0.0" subdirectory and migrating graphroot
metadata into it when user namespaces are available in the daemon
(currently only in experimental), change the graphroot dir permissions
to only include the execute bit for "other" users.

This allows easy migration to and from user namespaces and will allow
easier integration of user namespace support into the master build.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: e8532023f20498e6eb1ce5c079dc8a09aeae3061
Component: engine
2016-01-05 11:51:14 -05:00
eb346ff358 Use direct filesystem access for tar-split on aufs
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 0641429ad8a474c25eb99ee3c5a969b28baaad21
Component: engine
2016-01-04 09:41:02 -08:00
6e4bd4dbf1 Move graph driver registration out of the daemon package.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 91154e9235c71bc120b93d2e16632970e0f0ce0e
Component: engine
2015-12-28 13:02:24 -05:00
2526161bde Remove the graph driver from the daemon, move it into the layer store.
Support restoreCustomImage for windows with a new interface to extract
the graph driver from the LayerStore.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: f5916b10ae02c7db83052a97205ac345a3d96300
Component: engine
2015-12-28 12:55:48 -05:00
3ad8eda6ea ingnore the NotExist error when removing inexistent files
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: de7f6cf16be659cca9217ece6e5dc1221706d504
Component: engine
2015-12-25 15:19:48 +08:00
b064975176 Remove migrateIfDownlevel and aufs migration from docker pre-0.7
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 0673361ef6a0439b79239efb000574ae991b84f7
Component: engine
2015-12-22 16:45:42 -05:00
8b5a2050f9 loopback: separate loop logic from devicemapper
The loopback logic is not technically exclusive to the devicemapper
driver. This reorganizes the code such that the loopback code is usable
outside of the devicemapper package and driver.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: af597527121c0ad973e9d0ae4f9cf970da1513cc
Component: engine
2015-12-18 10:57:43 -05:00
2d549dabbf Merge pull request #18686 from cpuguy83/fix_btrfs_subvol_delete_panic
Fix btrfs recursive btrfs subvol delete
Upstream-commit: f57d56350ecf02a88f38219f55cbc42c1a9e07b5
Component: engine
2015-12-16 14:26:40 -05:00
4738f86f62 Merge pull request #18682 from calavera/replace_units_package
Replace pkg/units with docker/go-units.
Upstream-commit: b44b5bbc8ba48f50343602a21e7d44c017c1e23d
Component: engine
2015-12-16 10:48:59 -08:00
3d517a11e5 Replace pkg/units with docker/go-units.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 4fef42ba206ac90346e6e0fe25bead3f77dc4b0f
Component: engine
2015-12-16 12:26:49 -05:00
91750ca308 reorder imports with goimports
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: baba1a84935bd2114d48f1f4823ee9c379d62e68
Component: engine
2015-12-16 16:50:25 +01:00
341415cdcb Fix btrfs recursive btrfs subvol delete
Really fixing 2 things:

1. Panic when any error is detected while walking the btrfs graph dir on
removal due to no error check.
2. Nested subvolumes weren't actually being removed due to passing in
the wrong path

On point 2, for a path detected as a nested subvolume, we were calling
`subvolDelete("/path/to/subvol", "subvol")`, where the last part of the
path was duplicated due to a logic error, and as such actually causing
point #1 since `subvolDelete` joins the two arguemtns, and
`/path/to/subvol/subvol` (the joined version) doesn't exist.

Also adds a test for nested subvol delete.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: f9befce2d38614de3dfa474bc0f2e1b9937a8ca2
Component: engine
2015-12-15 18:12:40 -05:00
bc2d1566f2 devmapper: store base device fs type
After the very first init of the graph `docker info` correctly shows the
base fs type under `Backing Filesystem`. This information isn't stored
anywhere. After a restart (w/o erasing `/var/lib/docker`) `docker info`
shows an empty string under `Backing Filesystem`.
This patch records the base fs type after the first run in the metadata
or, to fix old devices that don't have this info in the metadata, just
probe the fs type of the base device at graph startup.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: f22ee02c6d6bd16f2179e71366ec641a7d234e96
Component: engine
2015-12-15 09:33:19 +01:00
f1d7c7a10b Make daemon/graphdriver/devmapper log messages with a common, consistent prefix.
Closes #16667

Uses the prefix "devmapper:" for all the fmt and logrus error, debug, and info messages.

Signed-off-by: Chris Dituri <csdituri@gmail.com>
Upstream-commit: 0aa6ace6e6e819551d21ebdcaa0c5802f76d7603
Component: engine
2015-12-14 21:35:13 -06:00
3c4fcf6b7a Fix typos found across repository
Signed-off-by: Justas Brazauskas <brazauskasjustas@gmail.com>
Upstream-commit: 927b334ebfc786276a039e45ec097e71bf9a104c
Component: engine
2015-12-13 18:04:12 +02:00
1aaaffc214 Fixed typo change deivce to device.
This changes deivce to device in daemon, test and docs.

Signed-off-by: Christopher Jones <tophj@linux.vnet.ibm.com>
Upstream-commit: 7c077c2c3443fdb9b13b7790bc96cdaa287cf381
Component: engine
2015-12-10 15:23:05 -06:00
cb952213f7 devmapper: remove unused var
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 037cbcec989f7867b6062455e8b042b8d2b0ab18
Component: engine
2015-12-10 08:28:02 +01:00
6021acc699 Fix overlay and user namespace permissions
All underlay dirs need proper remapped ownership. This bug was masked by the
fact that the setupInitLayer code was chown'ing the dirs at startup
time. Since that bug is now fixed, it revealed this permissions issue.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 191cefbaca45ba86341379d09d2f75d5fc1868fb
Component: engine
2015-12-08 14:28:28 -05:00
8c2653fb9a fix Put without Get in aufs
this Patch is ported from 3916561619d45a3d8ca17dfa467149824111023a

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: 451f7517733087a8629fe20894b6c10a63bb155e
Component: engine
2015-12-03 22:22:25 +08:00
5e25f840c3 Fix Put without Get in devicemapper
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: f7bdb973578a08a5012c741e4ebb262d2dd81165
Component: engine
2015-12-03 22:22:25 +08:00
b17c4f91f6 devmapper: Log start and end of filesystem creation
ext4 filesystem creation can take a long time on 100G thin device and
systemd might time out and kill docker service. Often user is left thinking
why docker is taking so long and logs don't give any hint. Log an info
message in journal for start and end of filesystem creation. That way
a user can look at logs and figure out that filesystem creation is
taking long time.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: a489e685c0d17455463945316cfe366e4e65dca6
Component: engine
2015-12-01 13:05:46 +00:00
e105a29374 Update daemon and docker core to use new content addressable storage
Add distribution package for managing pulls and pushes. This is based on
the old code in the graph package, with major changes to work with the
new image/layer model.

Add v1 migration code.

Update registry, api/*, and daemon packages to use the reference
package's types where applicable.

Update daemon package to use image/layer/tag stores instead of the graph
package

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 4352da7803d182a6013a5238ce20a7c749db979a
Component: engine
2015-11-24 09:40:25 -08:00
f3cdb6f05f Merge pull request #17974 from anusha-ragunathan/fsMagic
Fix devmapper backend in docker info
Upstream-commit: 1ecb9a40db176489ac8760251abe56e560bc848d
Component: engine
2015-11-17 11:44:48 -08:00
07479c944e Merge pull request #16452 from rhatdan/btrfs-selinux
Relabel BTRFS Content on container Creation
Upstream-commit: 4dda67b8014e71508e992c736febc5c45c53c095
Component: engine
2015-11-17 11:03:40 -08:00
c9ee279a92 Merge pull request #17479 from coolljt0725/show_warning
Show warning when user specify dm.basesize for already initialized devicemapper driver
Upstream-commit: cf824d974922ae7ad55548b3f0050a2bb0e29aa2
Component: engine
2015-11-15 08:51:33 +01:00
666ae52a68 Fix devmapper backend in docker info
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Upstream-commit: fdc2641c2b329c48cf1d1c8c0b806bec8784b3e0
Component: engine
2015-11-13 21:05:47 -08:00
c077545d83 Relabel BTRFS Content on container Creation
This change will allow us to run SELinux in a container with
BTRFS back end.  We continue to work on fixing the kernel/BTRFS
but this change will allow SELinux Security separation on BTRFS.

It basically relabels the content on container creation.

Just relabling -init directory in BTRFS use case. Everything looks like it
works. I don't believe tar/achive stores the SELinux labels, so we are good
as far as docker commit.

Tested Speed on startup with BTRFS on top of loopback directory. BTRFS
not on loopback should get even better perfomance on startup time.  The
more inodes inside of the container image will increase the relabel time.

This patch will give people who care more about security the option of
runnin BTRFS with SELinux.  Those who don't want to take the slow down
can disable SELinux either in individual containers or for all containers
by continuing to disable SELinux in the daemon.

Without relabel:

> time docker run --security-opt label:disable fedora echo test
test

real    0m0.918s
user    0m0.009s
sys    0m0.026s

With Relabel

test

real    0m1.942s
user    0m0.007s
sys    0m0.030s

Signed-off-by: Dan Walsh <dwalsh@redhat.com>

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
Upstream-commit: 1716d497a420f0cd4e53a99535704c6d215e38c7
Component: engine
2015-11-11 14:49:27 -05:00
abd797dbbd devmapper: Switch to xfs as default filesystem if supported
If platform supports xfs filesystem then use xfs as default filesystem 
for container rootfs instead of ext4. Reason being that ext4 is pre-allcating
lot of metadata (around 1.8GB on 100G thin volume) and that can take long
enough on AWS storage that systemd times out and docker fails to start.

If one disables pre-allocation of ext4 metadata, then it will be allocated
when containers are mounted and we will have multiple copies of metadata
per container. For a 100G thin device, it was around 1.5GB of metadata
per container.

ext4 has an optimization to skip zeroing if discards are issued and
underlying device guarantees that zero will be returned when discarded
blocks are read back. devicemapper thin devices don't offer that guarantee
so ext4 optimization does not kick in. In fact given discards are optional
and can be dropped on the floor if need be, it looks like it might not be
possible to guarantee that all the blocks got discarded and if read back
zero will be returned.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 07ff17fb850e5ddae6f38cc21776ebb9b1690f3e
Component: engine
2015-11-11 12:07:35 -05:00
edb4695814 devmapper: Warn if user specified a filesytem and base device already has fs
If user wants to use a filesystem it can be specified using dm.fs=<filesystem>
option. It is possible that docker already had base image and a filesystem
on that. Later if user wants to change file system using dm.fs= option
and restarts docker, that's not possible. Warn user about it.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 83a34e000b2332d9a1b4214a77fae021ed144acb
Component: engine
2015-11-11 12:07:35 -05:00
199c5fdeef Merge pull request #16774 from tonistiigi/15643-aufs-plnk
Copy aufs hardlinks to top layer
Upstream-commit: 10667253951a783785d3236192428a5decca3fef
Component: engine
2015-11-11 07:59:41 +01:00
dd6061632b Show warning when user specify dm.basesize for already initialized devicemapper drive
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: e035d272232890cd01b5eabc1081041032affdc0
Component: engine
2015-11-10 14:50:19 +08:00
2f262fa249 Merge pull request #17431 from vdemeester/hope-it-does-not-broke-everything-again
Another try at dockerversion placeholder for library import
Upstream-commit: 58b270c338e831ac6668a29788c72d202f9fc251
Component: engine
2015-11-09 13:15:50 -08:00
48001c30bb dockerversion placeholder for library import
- Add a *version* file placeholder.
- Update autogen and builds to use it and an autogen build flag

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 8054a303870b81eebe05e38261c1b68197b68558
Component: engine
2015-11-09 19:32:46 +01:00
8fd542a1df Merge pull request #17757 from rhvgoyal/log-blkid-failure
devmapper: Provide more error information if blkid fails
Upstream-commit: 10df5647bd5c9e5946412bd58fefb5323f67bc49
Component: engine
2015-11-07 09:16:14 -05:00
a401f0d13c Merge pull request #17576 from Microsoft/10662-graphtest
Windows: Fix daemon\graphdriver\graphtest
Upstream-commit: 1ba280a8db8456649b661e292d687f1be7ed3468
Component: engine
2015-11-06 15:13:31 -08:00
eaec8fb727 devmapper: Provide more error information if blkid fails
Right now if blkid fails we are just logging a debug message and don;t return
the actual error to caller. Caller gets the error message that thin pool
base device UUID verification failed and it might give impression that thin
pool changed. But that's not the case. Thin pool is in such a state that we
could not even query the thin device UUID. Retrun error message appropriately
to make situation more clear.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 2c8b7c597ae43e28887a52a9fcb12273fe7d8797
Component: engine
2015-11-06 08:21:20 -05:00
ef88e7ace2 Remove LXC support.
The LXC driver was deprecated in Docker 1.8.
Following the deprecation rules, we can remove a deprecated feature
after two major releases. LXC won't be supported anymore starting on Docker 1.10.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 3b5fac462d21ca164b3778647420016315289034
Component: engine
2015-11-05 17:09:57 -05:00
8e6e6234af Windows: Fix daemon\graphdriver\graphtest
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 876496738116611d350a3ce196ad836291beb1fd
Component: engine
2015-10-31 21:14:18 -07:00
cc55863497 Revert "dockerversion placeholder for library-import"
This reverts commit d5cd032a86617249eadd7142227c5355ba9164b4.

Commit caused issues on systems with case-insensitive filesystems.
Revert for now

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b78ca243d9fc25d81c1b50008ee69f3e71e940f6
Component: engine
2015-10-27 21:23:53 -04:00
4d261096ec dockerversion placeholder for library-import
- Move autogen/dockerversion to version
- Update autogen and "builds" to use this package and a build flag

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d5cd032a86617249eadd7142227c5355ba9164b4
Component: engine
2015-10-27 20:36:07 +01:00
f6f1715608 devmapper: Drop devices lock before returning from function
cleanupDeleted() takes devices.Lock() but does not drop it if there are
no deleted devices. Hence docker deadlocks if one is using deferred
device deletion feature. (--storage-opt dm.use_deferred_deletion=true).

Fix it. Drop the lock before returning.

Also added a unit test case to make sure in future this can be easily
detected if somebody changes the function.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Upstream-commit: 2f16895ee94848e2d8ad72bc01968b4c88d84cb8
Component: engine
2015-10-19 17:51:17 -04:00
61e523114f Merge pull request #16303 from coolljt0725/add_docker_info_show_base_size
Add docker info show base filesystem size of container/image when use devicemapper
Upstream-commit: 5ecbc9747fab243136402ea78d65e928e6d4678b
Component: engine
2015-10-13 14:43:52 +02:00
ea754befe4 Copy aufs hardlinks to top layer
Show warning if old method is used.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ef05b83417e32f269daf798307adcf07fe6ef13f
Component: engine
2015-10-12 20:44:32 -07:00
eb67a37877 Calculate hash based image IDs on pull
Generate a hash chain involving the image configuration, layer digests,
and parent image hashes. Use the digests to compute IDs for each image
in a manifest, instead of using the remotely specified IDs.

To avoid breaking users' caches, check for images already in the graph
under old IDs, and avoid repulling an image if the version on disk under
the legacy ID ends up with the same digest that was computed from the
manifest for that image.

When a calculated ID already exists in the graph but can't be verified,
continue trying SHA256(digest) until a suitable ID is found.

"save" and "load" are not changed to use a similar scheme. "load" will
preserve the IDs present in the tar file.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: 504e67b867865a2835e8002c01087a2cfd7bfd0e
Component: engine
2015-10-12 10:51:28 -07:00
89e0fe4844 Comment: add some lines back
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: a066b94ef0b4e7d90a6418429b056883e407b665
Component: engine
2015-10-12 19:34:58 +08:00
fa4c923057 Add docker info show base filesystem size of container/image when use devicemapper
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 5c374c7137c3749bff7f85d3fad94290f63034db
Component: engine
2015-10-10 22:52:05 +08:00
93c2a19d83 Add user namespace (mapping) support to the Docker engine
Adds support for the daemon to handle user namespace maps as a
per-daemon setting.

Support for handling uid/gid mapping is added to the builder,
archive/unarchive packages and functions, all graphdrivers (except
Windows), and the test suite is updated to handle user namespace daemon
rootgraph changes.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 442b45628ee12ebd8e8bd08497896d5fa8eec4bd
Component: engine
2015-10-09 17:47:37 -04:00
e0d971daa6 Do not probe plugins for graph init unless -s
When `-s` is not specified, there is no need to ask if there is a plugin
with the specified name.

This speeds up unit tests dramatically since they don't need to wait the
timeout period for each call to `graphdriver.New`.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 3b16cb15b496edc3dc080560c7189e06e19c5343
Component: engine
2015-10-09 12:02:54 -04:00