Commit Graph

63 Commits

Author SHA1 Message Date
1461717d2e 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: 071cc18b58408eaa71575e0233a056475196b199
Component: engine
2013-09-30 17:35:02 -06:00
890bafe58d image: Unmount before removing device in error paths
The device remove fails unless we unmount first
Upstream-commit: 6f57e8025a0a03da8052edc30157f7677f65f208
Component: engine
2013-09-30 17:35:02 -06:00
17aec56f2a Image: unmount device before removing it on failures
If we don't do this the remove will fail due to EBUSY
Upstream-commit: ecdbdfdaea5497c34a0299e7efd97b8a44bd7314
Component: engine
2013-09-30 17:35:01 -06:00
6101a0a475 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: 2c71710b74829787a0c78f7e02f45d31935a996f
Component: engine
2013-09-30 17:35:01 -06:00
91d411052a applyLayer() use btrfs reflinks if availible
We use the new file copy helper which uses btrfs reflinks if availible.
Upstream-commit: 1a082ed245aaf55cc92e884c988865b195ea0cb7
Component: engine
2013-09-30 17:35:01 -06:00
9f8a6e47d8 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: 43a7d3d0e9e2fafcdc90cb84855e1bb3869d2729
Component: engine
2013-09-30 17:35:01 -06:00
84b4aeca21 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: 5d2ace3424516bd7cc8d4a57fcaddd00fa1c4b5d
Component: engine
2013-09-30 17:35:01 -06:00
74b00e51f4 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: fdbc2695fe00d522c5c1a962f9be2f802bf53943
Component: engine
2013-09-30 17:35:01 -06:00
12fbeaaae6 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: 9e64ebb29549db19a84b8cb514bea60c26184779
Component: engine
2013-09-30 17:35:01 -06:00
7d0232a89a 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: 6094257b28f2e4b5e1a6616c77961b5cec0c9195
Component: engine
2013-09-30 17:35:00 -06:00
79ab6381a5 Implement container.ExportRW() on device-mapper
Upstream-commit: b0626f403b168b9020a802ec3bc4ad8c9bbc2486
Component: engine
2013-09-30 17:34:59 -06:00
534a030a97 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: 1c5dc26a7c0a0abb7bc59174768ec309f6c5fd4f
Component: engine
2013-09-30 17:34:59 -06:00
11ba6503a7 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: 074f38d49377411cf0b805095c0d9909d4859f3c
Component: engine
2013-09-30 17:34:59 -06:00
0134fab2c6 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: a9ec1dbc9bec91e1c0f1b751a06680570a04e915
Component: engine
2013-09-30 17:34:59 -06:00
f4fd5894a2 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: d2ba3e200576c2bcceb81d8d3d65b86fbf49313b
Component: engine
2013-09-30 17:34:59 -06:00
3b80b99ef6 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: e368c8bb01b3c52c8e4c334c3a7f32556af9d632
Component: engine
2013-09-30 17:34:58 -06: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
915420b8dd Fixed checksum computing. Ensure checksum is computed when image metadata is loaded from disk. Fixed docker push workflow. Moved hash computing to utils
Upstream-commit: be7560890644759c0ddd229afed208c537f075d7
Component: engine
2013-05-06 10:56:10 -07:00
5a3c9e63e6 Implemented checksum computation on image creation (necessary for new push primitive)
Upstream-commit: 048fd671ef107aa14f02e6fe2db4a4100c23d37f
Component: engine
2013-05-06 10:52:42 -07:00
45f51cdc1d Implement -config and -command in CmdCommit in order to allow autorun
Upstream-commit: 51d6228261cdc379aade581ee504b2c59a3e02a9
Component: engine
2013-04-25 16:48:31 -07:00
e45cc3d0d4 Merge pull request #442 from dotcloud/fix_deleted_file_diff
Use aufs to handle parents whiteouts instead of doing it manually
Upstream-commit: 03e4704ae58cdd03eef23e873b5e0b964470001c
Component: engine
2013-04-22 18:23:46 -07:00
41f179ebb1 'docker push' buffers filesystem archives on disk instead of memory.
Upstream-commit: baacae8345febd688579ac29832c200c41602ed2
Component: engine
2013-04-21 14:23:55 -07:00
2c563ad6e8 Use aufs to handle parents whitouts instead of doing it manually
Upstream-commit: e49af5b6def4e69ae234549fbcd2dd2987949cab
Component: engine
2013-04-19 16:33:25 -07:00