Commit Graph

3720 Commits

Author SHA1 Message Date
Alexander Larsson 381ce94ef4 Add DeviceSetWrapper
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)
2013-09-30 17:35:00 -06:00
Alexander Larsson 99393cf3cf Delete corresponding Devices when deleting Images
If an image is deleted and there is a corresponding device
for that image we also delete the image.
2013-09-30 17:35:00 -06:00
Alexander Larsson 30890c7763 Runtime: Delete corresponding devices when deleting container 2013-09-30 17:35:00 -06:00
Alexander Larsson b0626f403b Implement container.ExportRW() on device-mapper 2013-09-30 17:34:59 -06:00
Alexander Larsson fda6ff9c27 Make TarFilter more useful
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.
2013-09-30 17:34:59 -06:00
Alexander Larsson b86f67126c Archive: Fix up tar commandline arguments in TarFilter()
There is no need to duplicate the compression flags for
every element in the filter.
2013-09-30 17:34:59 -06:00
Alexander Larsson 1c5dc26a7c 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.
2013-09-30 17:34:59 -06:00
Alexander Larsson 8e7cbbff50 devmapper: Base the device-mapper names on the root dir name
This means the default is "docker-*", but for tests we get separate
prefixes for each test.
2013-09-30 17:34:59 -06:00
Alexander Larsson 074f38d493 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
2013-09-30 17:34:59 -06:00
Alexander Larsson a9ec1dbc9b 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.
2013-09-30 17:34:59 -06:00
Alexander Larsson d2ba3e2005 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
2013-09-30 17:34:59 -06:00
Alexander Larsson 8f7361279c Runtime: Add MountMethod to allow AUFS and device-mapper to coexist 2013-09-30 17:34:59 -06:00
Alexander Larsson ca2f7f955e Runtime: Add DeviceSet singleton
This adds a DeviceSet singleton to the Runtime object which will be used for
any DeviceMapper dependent code.
2013-09-30 17:34:59 -06:00
Alexander Larsson 1d36b8c7b7 Server: Pass in device-mapper DeviceSet to server
This makes docker (but not docker-init) link to libdevmapper and will
allow it to use the DeviceSet
2013-09-30 17:34:59 -06:00
Alexander Larsson e6216793d9 Add DeviceSet interface
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.
2013-09-30 17:34:58 -06:00
Alexander Larsson e368c8bb01 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
2013-09-30 17:34:58 -06:00
Alexander Larsson 167601e858 Runtime: Automatically use docker-init if it exists
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.
2013-09-30 17:34:58 -06:00
Alexander Larsson b8dc7b5f1a Add a separate docker-init binary
This may be used for the .dockerinit case if the main binary is not
statically linked.
2013-09-30 17:34:58 -06:00
Alexander Larsson 7fb3bfed03 devmapper: Add simple tool to test the DeviceSet commands 2013-09-30 17:34:58 -06:00
Alexander Larsson 374a5e9913 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
2013-09-30 17:34:58 -06:00
Alexander Larsson 459bac7127 Add libdevmapper wrapper 2013-09-30 17:34:58 -06:00
Solomon Hykes 23015fa14d Merge pull request #1994 from metalivedev/1993-legalcontext
Fix #1993: add explanation for export restrictions
2013-09-30 16:33:46 -07:00
Thermionix fb46d911c2 Update archlinux.rst 2013-10-01 09:33:12 +10:00
Tianon Gravi 85b776995c Merge pull request #2051 from tianon/hack-dockerfile-refactor
Add cleanup/refactor portion of #2010 for hack and Dockerfile updates
2013-09-30 16:29:32 -07:00
Thatcher fa44555fb4 Merge pull request #2035 from dhrp/style-revamp
Changes to a new style for the docs. Includes version switcher.
2013-09-30 15:51:43 -07:00
Andy Rothfusz 3e7c50e8a1 Merge pull request #2033 from metalivedev/1969-cherrypick-fixcommitformat
Fix #1969 formatting, add information about multiline json
2013-09-30 14:55:11 -07:00
Tianon Gravi ccefe47897 Add cleanup/refactor portion of #2010 for hack and Dockerfile updates 2013-09-30 13:57:30 -06:00
Tianon Gravi ff85031980 Merge pull request #2039 from tianon/mkimage-centos
Add contrib/mkimage-centos.sh back (from #1621), and associated documentation link
2013-09-30 10:51:06 -07:00
Guillaume J. Charmes 017ecefd66 Merge pull request #2046 from dotcloud/2030-dockercfg_panic_err-fix
- Runtime: fix panic with wrong dockercfg file
2013-09-30 10:02:12 -07:00
Thermionix 88f710f0e7 Update archlinux.rst
The /etc/sysctl.conf file is deprecated
https://www.archlinux.org/news/deprecation-of-etcsysctlconf/
2013-09-30 22:44:09 +10:00
Victor Vieux 6496059154 fix panic with wrong dockercfg file 2013-09-30 11:07:32 +00:00
Victor Vieux bcce3cbdd1 Merge pull request #1995 from dotcloud/fix_attach_2
Fix the attach behavior with -i
2013-09-30 03:29:19 -07:00
Victor Vieux bbf644ed62 Merge pull request #2025 from dotcloud/2020_add_dockercfg_doc
add .dockercfg doc
2013-09-30 03:21:46 -07:00
Tianon Gravi d89ce09a76 Add contrib/mkimage-centos.sh back (from #1621), and associated documentation link 2013-09-28 07:54:34 -06:00
Thatcher Peskens e3e041b6bf Changes to a new style for the docs. Includes version switcher.
* added link to edit on GitHub
* Changed image source on homepage
* Made some changes to the structure, added the ability to have l3 navigation. Added warning, note and other styles.
* Fixed an image link, removed the .. :content: links because they were quicky and didn't look good, added pagelinks to current page of other versions.
* Moved the remote client api's to their own doc
2013-09-27 19:54:52 -07:00
Andy Rothfusz 0a35b1fb36 Added more context. 2013-09-27 19:07:12 -07:00
Andy Rothfusz 74d54b9b2e Fix #1969 formatting, add information about multiline json 2013-09-27 18:16:00 -07:00
Michael Crosby 31fd11860b Merge pull request #2032 from dotcloud/move-rm-to-client
Move run -rm to the cli only
2013-09-27 17:19:01 -07:00
Daniel Mizyrycki b081a740b3 Merge pull request #2006 from jo-m/master
Enable SSH Agent forwarding in Vagrant VM
2013-09-27 12:07:44 -07:00
Michael Crosby db869ecce5 Merge pull request #1589 from unclejack/479-add_rm_support_to_docker_run
Add -rm to docker run for removing a container on exit
2013-09-27 11:45:32 -07:00
Guillaume J. Charmes 537149829a
Fix the attach behavior with -i 2013-09-27 11:10:55 -07:00
Andy Rothfusz ba10e28927 Merge pull request #2009 from kyleconroy/master
Improve registry and index REST API documentation
2013-09-27 10:56:21 -07:00
Victor Vieux f4855a7cf0 add .dockercfg doc 2013-09-27 18:19:17 +02:00
unclejack 22e7e107ad automatically remove container via -rm
add AutoRemove to HostConfig
add -rm flag to docker run
add TestRunAutoRemove to test -rm
docs: add -rm to commandline/command/run
add hostConfig to container monitor
make monitor destroy the container via -rm

This adds support for automatically removing a container after it
exits. The removal of the container is handled on the server side.
2013-09-27 17:43:12 +03:00
Colin Dunklau edd90d46c7 Clearly point at detailed docs 2013-09-27 08:32:55 -05:00
Victor Vieux 514886c73d Merge pull request #2023 from alexlarsson/old_kernel
Image: Fix time setting for old kernels
2013-09-27 05:25:13 -07:00
Guillaume J. Charmes f435970695 Merge pull request #1842 from dotcloud/split_stdout_stderr
* Runtime: Split stdout stderr
2013-09-26 18:05:24 -07:00
Guillaume J. Charmes cb18a6e1b9
Update docs + fix endian issue 2013-09-26 17:36:21 -07:00
Alexander Larsson 75e958bf48 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.
2013-09-26 23:59:37 +02:00
Kyle Conroy ce05083d4b Fix copypasta errors 2013-09-26 14:57:02 -07:00