Commit Graph

3 Commits

Author SHA1 Message Date
0553a0af33 devmapper: Add simple tool to test the DeviceSet commands
Upstream-commit: 7fb3bfed03d4d2a88f0e76fd6b8425cc753f4547
Component: engine
2013-09-30 17:34:58 -06:00
bf4813911d devmapper: Add DeviceSet device-mapper helper
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: 374a5e9913112c5bde590e532bc0ba5e4afeda49
Component: engine
2013-09-30 17:34:58 -06:00
cdec248ebe Add libdevmapper wrapper
Upstream-commit: 459bac712709db4d188022539f4d59524b4b3670
Component: engine
2013-09-30 17:34:58 -06:00