Commit Graph

69 Commits

Author SHA1 Message Date
45b9d24be0 devicemapper: remove unused code
Upstream-commit: 153248b60f551d4cb92bce4f35b08084f554c62c
Component: engine
2013-10-16 23:23:35 +00:00
ecfa6df5b6 devmapper: Move all "raw" libdevmapper wrappers to devmapper.go
This separates out the DeviceSet logic a bit better from the raw
device mapper operations.

devicemapper: Serialize addess to the devicemapper deviceset

This code is not safe to run in multiple threads at the same time,
and neither is libdevmapper.

DeviceMapper: Move deactivate into UnmountDevice

This way the deactivate is atomic wrt othe device mapper operations
and will not fail with EBUSY if someone else starts a devicemapper
operation inbetween unmount and deactivate.

devmapper: Fix loopback mounting regression

Some changes were added to attach_loop_device which added
a perror() in a place that caused it to override errno so that
a later errno != EBUSY failed. This fixes that and cleans up
the error reporting a bit.

devmapper: Build on old kernels without LOOP_CTL_GET_FREE define
Upstream-commit: c77697a45ca615f66351a7363e93c3903e92553f
Component: engine
2013-10-11 16:30:02 -07:00
ff1de35e89 Small fixes
Upstream-commit: b8439987184df45ee9571f9eb9d607518d96aeb8
Component: engine
2013-10-03 18:04:14 -07:00
7dc11f73be Random improvments
Upstream-commit: 8b2f4aab232880cb0d7faa18ae12adb33f483b2c
Component: engine
2013-10-02 20:18:15 -07:00
05ac257fe9 Image: Fix time setting for old kernels
This is a better fix for futimes() on kernels not supporting O_PATH.
The previous fix broke when copying a device, as it tried to open it
and got and error.
Upstream-commit: 75e958bf48a83de5f3f80859aee96f3356d16d4b
Component: engine
2013-09-26 23:59:37 +02:00
715ce06407 go fmt and aufs support removed
Upstream-commit: ebfa24acb08504d8da3fcba8da897fed357f34b2
Component: engine
2013-09-26 15:40:13 +00:00
ceff235a4b Image.Changes: Deactivate image device after unmounting it
There is no need to keep the image device around if we were the
onces creating the device.
Upstream-commit: 6c7ae06435d6e288024691f1133d7a2a24fd8ef3
Component: engine
2013-09-26 15:09:33 +00:00
9f649d336c image: Unmount before removing device in error paths
The device remove fails unless we unmount first
Upstream-commit: 41399ac005caa4de2dbb744e48f058f6a15e2d2b
Component: engine
2013-09-26 15:09:33 +00:00
f2940537fb Image: unmount device before removing it on failures
If we don't do this the remove will fail due to EBUSY
Upstream-commit: 009d0f9d81bbd5e130520986ce84e8f097d88a52
Component: engine
2013-09-26 15:09:32 +00:00
fbdbec9ab5 image: Handle systems that don't support O_PATH when updating timestamp
Older kernel can't handle O_PATH in open() so this will
fail on dirs and symlinks. For dirs wa can fallback to
the normal Utimes, but for symlinks there is not much to do
but ignore their timestamps.
Upstream-commit: ed658156133862b3f181c9d3061be24b91435095
Component: engine
2013-09-26 15:09:32 +00:00
a3c699f6e9 applyLayer() use btrfs reflinks if availible
We use the new file copy helper which uses btrfs reflinks if availible.
Upstream-commit: 062a2b32e9500107841a52d3a63b9232a1cfde70
Component: engine
2013-09-26 15:09:32 +00:00
9e1662b046 Add trivial copy-based CoW backend
This creates a container by copying the corresponding files
from the layers into the containers. This is not gonna be very useful
on a developer setup, as there is no copy-on-write or general diskspace
sharing. It also makes container instantiation slower.

However, it may be useful in deployment where we don't always have a lot
of containers running (long-running daemons) and where we don't
do a lot of docker commits.
Upstream-commit: adae6849871fad0d74945fa1731712ea784e9a88
Component: engine
2013-09-26 15:09:32 +00:00
5f068e31ed Image.applyLayer: Be better at creating identical files
There are some changes here that make the file metadata better match
the layer files:

* Set the mode of the file after the chown, as otherwise the per-group/uid
  specific flags and e.g. sticky bit is lost
* Use lchown instead of chown
* Delay mtime updates to after all other changes so that later file
  creation doesn't change the mtime for the parent directory
* Use Futimes in combination with O_PATH|O_NOFOLLOW to set mtime on symlinks
Upstream-commit: 99c7d129f422b488f478bc7887f37003dacc83e6
Component: engine
2013-09-26 15:09:32 +00:00
ee414671bb devmapper: Move init layer to top rather than bottom
The init layer needs to be topmost to make sure certain files
are always there (for instance, the ubuntu:12.10 image wrongly
has /dev/shm being a symlink to /run/shm, and we need to override
that). However, previously the devmapper code implemented the
init layer by putting it in the base devmapper device, which meant
layers above it could override these files (so that ubuntu:12.10
broke).

So, instead we put the base layer in *each* images devmapper device.
This is "safe" because we still have the pristine layer data
in the layer directory. Also, it means we diff the container
against the image with the init layer applied, so it won't show
up in diffs/commits.
Upstream-commit: c199ed228baf0e5d33b7739cc2442a32dece7020
Component: engine
2013-09-26 15:09:32 +00:00
f82807f434 DeviceSet: Add UnmountDevice()
Right now this does nothing but add a new layer, but it means
that all DeviceMounts are paired with DeviceUnmounts so that we
can track (and cleanup) active mounts.
Upstream-commit: 251a7ed437c17ecb66d33782f0b42633033198dd
Component: engine
2013-09-26 15:09:31 +00:00
5e59cd4e23 Limit the amount of prints during normal runs
This removes some Debugf() calls and chages some direct prints to
Debugf(). This means we don't get a bunch of spew when running the
tests.
Upstream-commit: bc7fa7b95773d638754eb72e7921ac328acb2ad6
Component: engine
2013-09-26 15:09:31 +00:00
5c4c83afbc Implement container.ExportRW() on device-mapper
Upstream-commit: 94fa3c7bb5cadc31b64630b0fe8abfaeba0644aa
Component: engine
2013-09-26 15:08:55 +00:00
5f5630fd65 Implement docker diff for device-mapper
To do diffing we just compare file metadata, so this relies
on things like size and mtime/ctime to catch any changes.
Its *possible* to trick this by updating a file without
changing the size and setting back the mtime/ctime, but
that seems pretty unlikely to happen in reality, and lets
us avoid comparing the actual file data.
Upstream-commit: 8e8ef7cb5b208ac657af812ebc5ffa783664cf3b
Component: engine
2013-09-26 15:08:55 +00:00
abe30d5012 Image: Always create a .docker-id file in the devices we create
Without this there is really no way to map back from the device-mapper
devices to the actual docker image/container ids in case the json file
somehow got lost
Upstream-commit: b125f2334c7b68f624ee1eee06cb9d68922d0314
Component: engine
2013-09-26 15:08:55 +00:00
3fad97e978 Image: Deactivate image device when unmounting container
There is no need to keep all the device-mapper devices active, we
can just activate them on demand if needed.
Upstream-commit: a89a51128ecdf2db02a333a406752416de8a1db6
Component: engine
2013-09-26 15:08:54 +00:00
f67c857087 Image: Initial support for device-mapper mounts
This supports creating images from layers and mounting them
for running a container.

Not supported yet are:
* Creating diffs between images/containers
* Creating layers for new images from a device-mapper container
Upstream-commit: fcd41fe51ae0418d583f3d33dfac7fc0879ca30e
Component: engine
2013-09-26 15:08:54 +00:00
dc920bde90 Image: Add runtime and container id args to Mount()
We will later need the runtime to get access to the VolumeSet
singleton, and the container id to have a name for the volume
for the container
Upstream-commit: 8637ba710e8bd10ee36aa5c71f5ef54ab9037dfa
Component: engine
2013-09-26 15:08:54 +00:00
0c11df3e01 Merge pull request #1267 from sridatta/new-clean-init
* Runtime: Fix to "Inject dockerinit at /.dockerinit"
Upstream-commit: f6fa353dd8be732aaed20f0c64a5ae8ccc9f1dbc
Component: engine
2013-08-05 13:23:22 -07:00
c364da0b51 Remove unused parameter
Upstream-commit: 0f134b4bf81a4d0160932852854b190b7ee7e3b9
Component: engine
2013-07-29 11:30:17 -07:00
78c57a64f0 Refactor the image size storage
Upstream-commit: 0badda9f1587c11a13dca17c68b30addd757237c
Component: engine
2013-07-29 11:30:17 -07:00
e9895c9839 Refactor checksum
Upstream-commit: 8ca7b0646e6c4346075656f46847f53c2e868a3d
Component: engine
2013-07-29 11:30:17 -07:00
15664f4161 use 0755 instead of 0700
Upstream-commit: 1c509f4350d943c6aa8b9bff8dcbed28ee803735
Component: engine
2013-07-25 15:45:15 +00:00
7c7e6abf06 + Runtime: inject dockerinit at /.dockerinit instead of overwriting /sbin/init. This makes it possible to run /sbin/init inside a container.
Upstream-commit: 5d8efc107d2c7b7da61a6d22657190c6f13713d2
Component: engine
2013-07-17 17:13:34 -07:00
84dca8f32c Fix #1162 - Remove bufio from Untar
Upstream-commit: 08a87d4b3b3f76ac9d73309b1042aa75d6634ed9
Component: engine
2013-07-08 13:42:17 -07:00
692004c87b Fix a bug which caused creation of empty images (and volumes) to crash. FIxes #995.
Upstream-commit: 290b1973a90e39f2b7f751f038633b9e6e4a1694
Component: engine
2013-06-22 12:29:42 -07:00
730a1370b2 Merge branch 'master' into 22-add_sizes_images_and_containers-feature
Upstream-commit: ddf5a1940fdbe2efa7136e7f5f26c2adc1a59b3e
Component: engine
2013-06-14 10:05:06 +00:00
5bf955bfcc fix virtual size on images
Upstream-commit: 00cf2a1fa264c167dff0dd50e296c93d4c59908f
Component: engine
2013-06-14 10:05:01 +00:00
fafb25034a bump to master again
Upstream-commit: bf63cb904592e1ca73aa3990c08ea0b752fec14d
Component: engine
2013-06-05 16:01:36 +00:00
dfee088c2a move xino stuff to /dev/shm
Upstream-commit: f67ea78cce83114998390c16305a6869c72f5100
Component: engine
2013-06-05 12:59:05 +00:00
4747c5b99f linted names
Upstream-commit: fd224ee590dc9f003f6507b529a9f47cceb02c44
Component: engine
2013-06-04 18:00:22 +00:00
9c0086fb7d drop/omit
Upstream-commit: 86ada2fa5d00820288df8a59eca3deef83f4aeb6
Component: engine
2013-06-04 13:51:12 +00:00
39f3a9ee0e add arch field to image struct
Upstream-commit: 2cf92abf0eff49b21812d88e74813b8848f9b758
Component: engine
2013-05-24 21:41:30 +03:00
8c3121bf04 bump to master
Upstream-commit: 6fce89e60b71ee2306d66003697b6c746c456250
Component: engine
2013-05-22 13:41:29 +00:00
88a9363cae Split registry into subpackage
Upstream-commit: 9bb3dc9843f4ef565eb8f298eb7f542b5e1ac0dd
Component: engine
2013-05-15 01:41:39 +00:00
bc6fad489c Create a subpackage for utils
Upstream-commit: 2e69e1727b4d5698a90c24c5800eecd5401dc319
Component: engine
2013-05-14 22:37:35 +00:00
e0c6a8e8bb add sizes in images and containers
Upstream-commit: a91b710961b74341543a81b9d16f66d65b1907f1
Component: engine
2013-05-13 15:14:20 +02:00
76711c8930 Factorize the checksums functions
Upstream-commit: 44b33b44aa1445bad0bcb5852c7a1606e30620f7
Component: engine
2013-05-08 22:37:33 -07:00
cce89c679d Store the actual archive when commit
Upstream-commit: aaaf3f072601923594754e46c1f0152847d9c2d9
Component: engine
2013-05-08 19:08:11 -07:00
dd5e4add4f Store the checksums when pulling a repository
Upstream-commit: 0e23b4e10ec7f7c49c5715cd115f859319adf476
Component: engine
2013-05-08 16:27:35 -07:00
c6f97b4c7e Make the checksum async within commit
Upstream-commit: 8ff1765674c93a169fe29483503709a008f30618
Component: engine
2013-05-08 12:01:12 -07:00
9dcac35c2d Use make instead of new
Upstream-commit: c4ebf870c8a9cef909e66fb517e607896ea8a518
Component: engine
2013-05-08 10:35:41 -07:00
b90c56ad14 gofmt pass
Upstream-commit: d985050aeb3f1411b94b21f6db35a24f9a1f93f2
Component: engine
2013-05-06 10:57:36 -07:00
815f14e3c7 simplify image.Checksum
Upstream-commit: be791a223b65d5641e032ea78ad7289b6eb58979
Component: engine
2013-05-06 10:56:55 -07:00
140338cd02 Fix checksum computing
Upstream-commit: f10b0f75e02041db64176760a3be9639408ad923
Component: engine
2013-05-06 10:56:50 -07:00
e2645da3a8 Checksum system overhaul
Upstream-commit: 6e2ddf6f608aa3d73b26b22dc3ff27f11534cdee
Component: engine
2013-05-06 10:56:49 -07:00