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
lxc-start requires / to be mounted private, otherwise the changes
it does inside the container (both mounts and unmounts) will propagate
out to the host.
We work around this by starting up lxc-start in its own namespace where
we set / to rprivate.
Unfortunately go can't really execute any code between clone and exec,
so we can't do this in a nice way. Instead we have a horrible hack that
use the unshare command, the shell and the mount command...
Upstream-commit: e40f5c7cb90fbc719241ace45b05c2c61aced658
Component: engine
We can't look for the created file in the rwpath, because that
doesn't exist in the device-mapper world, instead look in the
RootfsPath.
Upstream-commit: 2566e2604c2e079f9597749a1da11f22bb39eb51
Component: engine
We unmount all mounts and deactivate all device mapper devices to
make sure we're left with no leftovers after the test.
Upstream-commit: c6e8813c979bbea8832f47dc6468e805a1a18c3e
Component: engine
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
This directory is copied to each test prefix which is really
slow with the large loopback mounts.
Upstream-commit: a7fd1fce5d6fb29a8c627022da7cbbf0f4b740c7
Component: engine
I currently need this to get the tests running, otherwise it will
mount the docker.test binary inside the containers, which doesn't
work due to the libdevmapper.so dependency.
Upstream-commit: 6938a36c6985336205f1db247baec5e56fdac466
Component: engine
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
We wrap the "real" DeviceSet for each test so that we get only
a single device-mapper pool and loopback mounts, but still
separate out the IDs in the tests. This makes the test run
much faster.
Upstream-commit: d47c18c5fbe50a2ad6ec011704f86a3c27360ff9
Component: engine
This wraps an existing DeviceSet and just adds a prefix to all ids in
it. This will be useful for reusing a single DeviceSet for all the tests
(but with separate ids)
Upstream-commit: 0e686fa2f4d38eb6253e92ad701dd4c9caebfdce
Component: engine
If an image is deleted and there is a corresponding device
for that image we also delete the image.
Upstream-commit: 3f3f5f0bbaafc67d3f77b920194f8d7bfb7bf6ee
Component: engine
There are a few changes:
* Callers can specify if they want recursive behaviour or not
* All file listings to tar are sent on stdin, to handle long lists better
* We can pass in a list of filenames which will be created as empty
files in the tarball
This is exactly what we want for the creation of layer tarballs given
a container fs, a set of files to add and a set of whiteout files to create.
Upstream-commit: 223280f31967edb7b3eb325cce8a3b82939c0f2b
Component: engine
There is no need to duplicate the compression flags for
every element in the filter.
Upstream-commit: 8f23945f7f666e3151890de90ebb39db3c7f5ada
Component: engine
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
This means the default is "docker-*", but for tests we get separate
prefixes for each test.
Upstream-commit: 8f343ea65a05b374ffa64940a1946abf28402689
Component: engine
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
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
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
This adds a DeviceSet singleton to the Runtime object which will be used for
any DeviceMapper dependent code.
Upstream-commit: f317a6b6fe31685445ac97a1475136c5ab7860b5
Component: engine
This makes docker (but not docker-init) link to libdevmapper and will
allow it to use the DeviceSet
Upstream-commit: 87e248f52458eca2a40ed6e54e36de89228f6790
Component: engine
This interface matches the device-mapper implementation (DeviceSetDM)
but is free from any dependencies. This allows core docker code
to refer to a DeviceSet without having an explicit dependency on
the devmapper package.
This is important, because the devmapper package has external
dependencies which are not wanted in the docker client app, as it
needs to run with minimal dependencies in the docker image.
Upstream-commit: ac194fc696fb95045ee5b634d04a9f7093f45685
Component: engine
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
In some builds the main docker binary is not statically linked,
and as such not usable in as the .dockerinit binary, for those
cases we look for a separately shipped docker-init binary and
use that instead.
Upstream-commit: 0f5ccf934e01c75e467e6f35e883cf95bae74f2c
Component: engine
This may be used for the .dockerinit case if the main binary is not
statically linked.
Upstream-commit: 250bc3f61547c6bcdc17ffe41e8a9a0307099cc3
Component: engine
This is a module that uses the device-mapper create CoW snapshots
You instantiate a DeviceSetDM object on a specified root (/var/lib/docker),
and it will create a subdirectory there called "loopback". It will
contain two sparse files which are loopback mounted into
a thin-pool device-mapper device called "docker-pool".
We then create a base snapshot in the pool with an empty filesystem
which can be used as a base for docker snapshots. It also keeps track
of the mapping between docker image ids and the snapshots in the pool.
Typical use of is something like (without error checking):
devices = NewDeviceSetDM("/var/lib/docker")
devices.AddDevice(imageId, "") // "" is the base image id
devices.MountDevice(imageId, "/mnt/image")
... extract base image to /mnt/image
devices.AddDevice(containerId, imageId)
devices.MountDevice(containerId, "/mnt/container")
... start container at /mnt/container
Upstream-commit: 0b12702c0c9753cbb18a942bac2600b036e4f80e
Component: engine
Replace deprecated upgrading reference to docker-latest.tgz, which hasn't been updated since 0.5.3
Upstream-commit: 06c1f000e8791b9cc62eeb2e5edbeeb326a03de6
Component: engine
Update Gentoo installation documentation now that we're in the portage tree proper
Upstream-commit: 00b3acb8ab5ad97aded2e3e7c6d554e47a28467d
Component: engine
We're officially a first-class Gentoo citizen now, which is very exciting. Many thanks to @gregkh for helping us get here.
I started just adapting sections of language in this document, and realized several bits needed to just be rewritten entirely to be more clear.
Upstream-commit: d06116d2e8a70477b3d8b02cd9e57f7465edc0ce
Component: engine
* Hack: Add several of the small make.sh fixes from #1920, and make the output more consistent and contributor-friendly
Upstream-commit: a59a66528baef4eb7593827515016814fdf1ef3e
Component: engine