1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

3457 commits

Author SHA1 Message Date
Alexander Larsson
d951911b23 Always start tests from a clean set of loopback images
This way we don't get any issues with leftovers
2013-09-30 17:35:01 -06:00
Alexander Larsson
7fb60caa5d tests: Store the loopback images for test outside unit-tests
This directory is copied to each test prefix which is really
slow with the large loopback mounts.
2013-09-30 17:35:01 -06:00
Alexander Larsson
76a2ab6e34 Allow specifying the docker client path in _DOCKER_INIT_PATH
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.
2013-09-30 17:35:00 -06:00
Alexander Larsson
6094257b28 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.
2013-09-30 17:35:00 -06:00
Alexander Larsson
52294192b2 Reuse a single DeviceSetDM for all the tests
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.
2013-09-30 17:35:00 -06:00
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 from metalivedev/1993-legalcontext
Fix : add explanation for export restrictions
2013-09-30 16:33:46 -07:00
Tianon Gravi
85b776995c Merge pull request from tianon/hack-dockerfile-refactor
Add cleanup/refactor portion of  for hack and Dockerfile updates
2013-09-30 16:29:32 -07:00
Thatcher
fa44555fb4 Merge pull request 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 from metalivedev/1969-cherrypick-fixcommitformat
Fix  formatting, add information about multiline json
2013-09-30 14:55:11 -07:00
Tianon Gravi
ccefe47897 Add cleanup/refactor portion of for hack and Dockerfile updates 2013-09-30 13:57:30 -06:00
Tianon Gravi
ff85031980 Merge pull request from tianon/mkimage-centos
Add contrib/mkimage-centos.sh back (from ), and associated documentation link
2013-09-30 10:51:06 -07:00
Guillaume J. Charmes
017ecefd66 Merge pull request from dotcloud/2030-dockercfg_panic_err-fix
- Runtime: fix panic with wrong dockercfg file
2013-09-30 10:02:12 -07:00
Victor Vieux
6496059154 fix panic with wrong dockercfg file 2013-09-30 11:07:32 +00:00
Victor Vieux
bcce3cbdd1 Merge pull request 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 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 ), 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 formatting, add information about multiline json 2013-09-27 18:16:00 -07:00
Michael Crosby
31fd11860b Merge pull request 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 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 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 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
Guillaume J. Charmes
f435970695 Merge pull request 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
Kyle Conroy
ce05083d4b Fix copypasta errors 2013-09-26 14:57:02 -07:00