Commit Graph

82 Commits

Author SHA1 Message Date
8e8fff205d Merge pull request #8813 from jlhawn/aufs_exclude_on_tar_layer
Exclude `.wh..wh.*` AUFS metadata on layer export
Upstream-commit: 6718791ea28be1bd6bce49cd9f49844c24f9dcf7
Component: engine
2014-11-04 11:38:12 -05:00
4e9f4b9a1b mount: move the MakePrivate to pkg/mount
The logic is unrelated to graphdriver.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 930a756ad55ad5f4e5e6391b41673743d7254c2b
Component: engine
2014-10-30 17:04:56 -04:00
f5026cfb78 Exclude .wh..wh.* AUFS metadata on layer export
In an effort to make layer content 'stable' between import
and export from two different graph drivers, we must resolve
an issue where AUFS produces metadata files in its layers
which other drivers explicitly ignore when importing.

The issue presents itself like this:

    - Generate a layer using AUFS
    - On commit of that container, the new stored layer contains
      AUFS metadata files/dirs. The stored layer content has some
      tarsum value: '1234567'
    - `docker save` that image to a USB drive and `docker load`
      into another docker engine instance which uses another
      graph driver, say 'btrfs'
    - On load, this graph driver explicitly ignores any AUFS metadata
      that it encounters. The stored layer content now has some
      different tarsum value: 'abcdefg'.

The only (apparent) useful aufs metadata to keep are the psuedo link
files located at `/.wh..wh.plink/`. Thes files hold information at the
RW layer about hard linked files between this layer and another layer.
The other graph drivers make sure to copy up these psuedo linked files
but I've tested out a few different situations and it seems that this
is unnecessary (In my test, AUFS already copies up the other hard linked
files to the RW layer).

This changeset adds explicit exclusion of the AUFS metadata files and
directories (NOTE: not the whiteout files!) on commit of a container
using the AUFS storage driver.

Also included is a change to the archive package. It now explicitly
ignores the root directory from being included in the resulting tar archive
for 2 reasons: 1) it's unnecessary. 2) It's another difference between
what other graph drivers produce when exporting a layer to a tar archive.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 0d97e082c3b849a6901992e653b8963e8ef10f54
Component: engine
2014-10-28 10:14:05 -07:00
657fc47397 Use archive.CopyWithTar in vfs.Create
The vfs storage driver currently shells out to the `cp` binary on the host
system to perform an 'archive' copy of the base image to a new directory.
The archive option preserves the modified time of the files which are created
but there was an issue where it was unable to preserve the modified time of
copied symbolic links on some host systems with an outdated version of `cp`.

This change no longer relies on the host system implementation and instead
utilizes the `CopyWithTar` function found in `pkg/archive` which is used
to copy from source to destination directory using a Tar archive, which
should correctly preserve file attributes.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: b6db23cffe942b8d94c80d1e9b3f1f6fca87d139
Component: engine
2014-10-27 11:38:22 -07:00
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
cde87628c0 Merge pull request #8232 from vbatts/vbatts-devmapper_getDeps
devmapper: include dm_deps information in debug
Upstream-commit: 2f9ffe5b6ac1c547d1b5c228637007b05af48a3f
Component: engine
2014-10-16 14:13:21 -07:00
afe8e130e0 Move archive package into pkg/archive
Now that the archive package does not depend on any docker-specific
packages, only those in pkg and vendor, it can be safely moved into pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Upstream-commit: 30d5a42c1f24e26f681b7330249f04fec891aee9
Component: engine
2014-09-29 23:23:36 -07:00
6e9ab87c7d devmapper: include the version in info
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 5630d466b28283c4d52ecfa5859a67112e8ccaa4
Component: engine
2014-09-25 15:51:02 -04:00
237330891b devmapper: include dm_deps information in debug
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 8e7aa44f0e610f471dec9dd232599b4b9cba80b2
Component: engine
2014-09-25 10:59:23 -04:00
dd5abc97c6 devmapper: resizepool hardcodes files as well
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 636e8561a86ffba909790e9188ffe282770570f0
Component: engine
2014-09-22 17:03:31 -04:00
b69ca50509 devmapper: docker info devices hard coded
If `--storage-opt dm.datadev=/dev/loop0 --storage-opt
dm.metadatadev=/dev/loop1 ` were provided, the information was not
reflected in the information output.

Closes: #7137

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 7e9ba22dc358196ac0d13524aa05677327f19ff9
Component: engine
2014-09-22 16:40:20 -04:00
ec0fc2a729 graphdriver interface name change, typo fix
Signed-off-by: Josh Hawn <josh.hawn@docker.com>
Upstream-commit: 09ad65ebd5b50fdd7621f42136278102586a7ea8
Component: engine
2014-09-16 15:10:32 -07:00
861f46b221 Refactor use of graphdriver.Differ
Some graphdrivers are Differs and type assertions are made
in various places throughout the project. Differ offers some
convenience in generating/applying diffs of filesystem layers
but for most graphdrivers another code path is taken.

This patch brings all of the logic related to filesystem
diffs in one place, and simplifies the implementation of some
common types like Image, Daemon, and Container.

Signed-off-by: Josh Hawn <josh.hawn@docker.com>
Upstream-commit: dee6b481fe0da1d845261ffff2e610fb05898d3c
Component: engine
2014-09-16 15:10:32 -07:00
560885c335 Merge pull request #7698 from tamsky/tune2fs_base_filesystem
use tune2fs to disable ext4 mount counts and mount intervals
Upstream-commit: a10a86d437148fe93c0ad128a233f42b17b22700
Component: engine
2014-09-15 15:42:52 +03:00
2a0b4ab45f Change default label of container volumes to shared SELinux Label
Since these will be shared between containers we want to label
them as svirt_sandbox_file_t:s0.  That will allow multiple containers
to write to them.

Currently we are allowing container domains to read/write all content in
/var/lib/docker because of container volumes.  This is a big security hole
in our SELinux story.

This patch will allow us to tighten up the security of docker containers.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 73617e5e18159e5f791d2860c7857cd5dea31be4
Component: engine
2014-09-09 08:18:20 -04:00
7261074190 use tune2fs to disable ext4 mount counts and mount intervals
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
Upstream-commit: d229821501d75fdb86424c3817aa6b7af8459afe
Component: engine
2014-09-05 19:32:39 -07:00
05579b5900 fix typos in error messages
Signed-off-by: Ward Vandewege <ward@jhvc.com> (github: cure)
Upstream-commit: a447894946ca2ac47bf1c46f78c4839c75fd740d
Component: engine
2014-09-03 13:12:10 -04:00
fe6985381c Use increment operator
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 16e850fe3ea42f5103c9a11f3db17d11dc4f6ada
Component: engine
2014-08-30 21:43:48 +04:00
65adfb2362 Fix data space reporting from Kb/Mb to KB/MB
Docker-DCO-1.1-Signed-off-by: Vivek Dasgupta <vdasgupt@redhat.com> (github: vivekdasgupta)
Upstream-commit: a327d9b91edf6d36ee5b286ebe968bcca6658f5b
Component: engine
2014-08-21 21:03:44 +05:30
9df494bb71 another commit to do like @crosbymichael
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: a0392324f194f4f92e3205f0c0ed8b71dc2fc93f
Component: engine
2014-08-14 01:36:26 +00:00
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
416ed08d2b Replace "amd64" build tags with "cgo" as appropriate, and remove where unnecessary
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 89ec17d11319ae39bff19985ac59fc878fe1fe1e
Component: engine
2014-08-06 17:20:21 -06:00
c3c811b0a6 Merge pull request #7430 from tamsky/docfixes
style, grammar, spelling fixes.
Upstream-commit: bc684fae642dbf585215b9518f469634a52a5524
Component: engine
2014-08-06 16:11:52 -07:00
a062aab14b add warning re: changing value of dm.basesize.
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
Upstream-commit: bd30746e07e18942cea4f2d15a45fd357c957e4f
Component: engine
2014-08-05 19:28:07 -07:00
88553ea651 style, grammar, spelling fixes.
Signed-off-by: Marc Tamsky <mtamsky@gmail.com> (github: tamsky)
Upstream-commit: 07099b62563f3201877995181825d4cd4822ed89
Component: engine
2014-08-05 18:11:32 -07:00
e25f77248d Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4398108433121ce2ac9942e607da20fa1680871a
Component: engine
2014-07-29 13:09:10 -07:00
2273fb0f55 gofmt -s -w
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 5a0ef08c940b9a17c400389bca8e7f54935ceba9
Component: engine
2014-07-24 22:25:29 +00:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
b57da60173 Merge pull request #6939 from snitm/thinp-blocksize-fix
devmapper: revert the default dm-thin-pool blocksize back to 64K
Upstream-commit: 840ed5ace28381e61b6b34063f9afb71d63fb6a9
Component: engine
2014-07-10 19:57:07 +03:00
323df0e24b Fix typos
Docker-DCO-1.1-Signed-off-by: Bryan Bess <squarejaw@bsbess.com> (github: squarejaw)
Upstream-commit: 1df4049e17e4a3edf4487b072f2085bc2dd2ee0b
Component: engine
2014-07-09 23:14:06 -05:00
0ee458dda8 devmapper: revert the default dm-thin-pool blocksize back to 64K
Commit 09ee269d ("devmapper: Add option for specifying the thin pool
blocksize") also switched the default dm-thin-pool blocksize from 64K to
512K.  That change unfortunately breaks the activation of dm-thin-pool
devices that were previously created using a 64K blocksize.  Here is an
example of the dm-thin-pool activation failure users may experience:

 device-mapper: thin: 253:4: pool target (204800 blocks) too small: expected 1638400
 device-mapper: table: 253:4: thin-pool: preresume failed, error = -22

The reason for this is docker is passing 512K as the blocksize for a
dm-thin-pool that was previously created using a 64K blocksize.  Docker
doesn't record the blocksize the is used when it creates a dm-thin-pool.
Until now it never had a need to do so because the blocksize was always
hardcoded.  The dm-thin-pool blocksize must be the same every time a
dm-thin-pool is activated.

As a stop-gap fix, revert to using 64K for the default blocksize.

But we do need a proper fix for this now that 'dm.blocksize' is exposed
as a proper storage option.  One possible fix would be to record the
blocksize for each dm-thin-pool that docker creates and to pass that
recorded blocksize down in the dmsetup table load each time the
dm-thin-pool is activated (this would be comparable to what lvm2 does).

Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: d715803d45d41bfbbd5faf1f4a8239c08d6d8c90
Component: engine
2014-07-09 16:47:30 -04:00
bfe0fa53e6 Merge pull request #6636 from saaadhu/master
Fix typo in README.md
Upstream-commit: f021cd64eda967f7e5a4b3a3f5c99fb7efe49c10
Component: engine
2014-07-08 16:35:26 -07:00
efbfc9bcff Merge pull request #6645 from snitm/dmthinp-devel
Dmthinp devel
Upstream-commit: 2e4f99d99c34edaba2d37270545af2b8fd753dab
Component: engine
2014-07-07 21:20:31 +03:00
d4f4419563 Change misnamed TarFilter to TarWithOptions
Docker-DCO-1.1-Signed-off-by: Travis Cline <travis.cline@gmail.com> (github: tmc)
Upstream-commit: 111ab125b954c8d28503e1922e742eb271cc5d04
Component: engine
2014-06-26 22:49:08 +00:00
9c28be7542 devmapper: add thin-pool blocksize to the 'docker info' output
Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: a2f3ce2294bbe998df24edd50f2b571d0b21bac8
Component: engine
2014-06-26 12:39:16 -04:00
fbe2366f74 devmapper: document the default DM thin pool blocksize
Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: 79f217e3501a43326bd532e8eb03182f7488f61c
Component: engine
2014-06-26 12:06:41 -04:00
bda9d074fe devmapper: remove extra space in DefaultThinpBlockSize assignment
Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: f9c078ef38106d00de7774374f3ac71bb0d562d3
Component: engine
2014-06-24 12:43:45 -04:00
e00d89f257 devmapper: Add option for specifying the thin pool blocksize
Add dm.blocksize option that you can use with --storage-opt to set a
specific blocksize for the thin provisioning pool.

Also change the default dm-thin-pool blocksize from 64K to 512K.  This
strikes a balance between the desire to have smaller blocksize given
docker's use of snapshots versus the desire to have more performance
that comes with using a larger blocksize.  But if very small files will
be used on average the user is encouraged to override this default.

Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: 09ee269d998ad04733ef577739fa051df9d3f12e
Component: engine
2014-06-24 12:10:28 -04:00
d61150b2d4 devmapper: use RAMInBytes() rather than FromHumanSize()
Device Mapper needs device sizes in binary (1024) multiples.  Otherwise
kernel checks can find that the specified thin-pool device sizes aren't
a multiple of the specified thin-pool blocksize.

The name for "RAMInBytes" is likely too narrow given the new consumers
but... Also add "tebibyte" support to RAMInBytes.

Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: 2470a5ed999d9dc8d4b9bd250727ac13964db5b3
Component: engine
2014-06-24 12:10:14 -04:00
157a125d05 devmapper: fix reloadPool() to also specify '1 skip_block_zeroing'
createPool() and reloadPool() should be consistent with the thin-pool
table params they use.

Since createPool() specifies '1 skip_block_zeroing' reloadPool() should
too.  Otherwise, if the pool is reloaded (as is done when resizing
loopback devices) block zeroing will be enabled after the reload
completes.

Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
Upstream-commit: d420134fa2ea8ceedf2a9a64263d09b308263c2c
Component: engine
2014-06-24 11:23:13 -04:00
7622154038 cp's -T and --reflink=auto are only available on GNU coreutils
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: 733711481ee665564f0f2a77d100353d5f9c82e2
Component: engine
2014-06-24 23:58:17 +09:00
417ba2a8cb Fix typo in README.md
Upstream-commit: 21e258d7328e56fd451e6ed0324cff094ec70798
Component: engine
2014-06-24 11:57:24 +05:30
37854d56d0 Merge pull request #6505 from vdloo/master
Fixes typo in loopback device error message
Upstream-commit: f3db32c03515353697644fabf4f73e0dfb1d4fc0
Component: engine
2014-06-18 15:55:51 -07:00
f362aed228 Fixes typo in loopback device error message
Docker-DCO-1.1-Signed-off-by: Rick van de Loo <rickvandeloo@gmail.com> (github: vdloo)
Upstream-commit: 98041d26bbe68458ca1c2ac7074ef600e832753e
Component: engine
2014-06-18 22:09:28 +02:00
172faefd3c Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f08cd445b0d2e44a4977a3bd0dca0a1cd4e76d2f
Component: engine
2014-06-18 17:39:57 +00:00
52b8a282c3 Update libcontainer imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8194556337b65dda71a3d4d7f6ae9653ad5a19a0
Component: engine
2014-06-10 19:58:15 -07:00
3c7670e68c Move libcontainer deps into libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 6158ccad97db51e756aafefb096d1163aa4d6439
Component: engine
2014-06-09 15:52:12 -07:00
12d535e2c7 Move remount as private to the graph drivers
If this is at the root directory for the daemon you could unmount
somones filesystem when you stop docker and this is actually only needed
for the palces that the graph drivers mount the container's root
    filesystems.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 3609b051b88565c0fe0615fd47ddb48eed549d27
Component: engine
2014-06-05 16:02:25 -07:00
9fb60c3559 Ensures files get closed properly. Closes #6213
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: b1ac791d8426cd7b6fb5a19f5e918b26c83d83f6
Component: engine
2014-06-05 15:13:43 -07:00