Commit Graph

217 Commits

Author SHA1 Message Date
a808fdbf65 Change Console to Terminal
Move creation and attach to driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 1e742876988546efb876f67f83de6737ee5e9cf6
Component: engine
2014-02-21 12:32:14 -08:00
a7d9996138 Cleanup some statements from exec driver work
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 9e3da87a3a6fea21194ceb9dbd30a39d043a48a4
Component: engine
2014-02-14 17:28:50 -08:00
e12f62e6df Properly close archives
All archive that are created from somewhere generally have to be closed, because
at some point there is a file or a pipe or something that backs them. So, we
make archive.Archive a ReadCloser. However, code consuming archives does not
typically close them so we add an archive.ArchiveReader and use that when we're
only reading.

We then change all the Tar/Archive places to create ReadClosers, and to properly
close them everywhere.

As an added bonus we can use ReadCloserWrapper rather than EofReader in several places,
which is good as EofReader doesn't always work right. For instance, many compression
schemes like gzip knows it is EOF before having read the EOF from the stream, so the
EofCloser never sees an EOF.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: f198ee525ad6862dce3940e08c72e0a092380a7b
Component: engine
2014-02-14 13:46:17 +01:00
e378922981 Move the canonical run configuration objects to a sub-package
* Config is now runconfig.Config
    * HostConfig is now runconfig.HostConfig
    * MergeConfig is now runconfig.Merge
    * CompareConfig is now runconfig.Compare
    * ParseRun is now runconfig.Parse
    * ContainerConfigFromJob is now runconfig.ContainerConfigFromJob
    * ContainerHostConfigFromJob is now runconfig.ContainerHostConfigFromJob

This facilitates refactoring commands.go and shrinks the core.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 6393c38339e11b4a099a460ecf46bb5cafc4283b
Component: engine
2014-02-11 20:18:46 -08:00
9ed97b673b Move even more stuff into dockerversion
Also, use it in all the places. :)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: da04f49b383c02ee28c32f948048b9e9a402bb4f
Component: engine
2014-02-11 17:26:54 -07:00
c19931ad4a Avoid extra mount/unmount during container registration
Runtime.Register() called driver.Get()/Put() in order to read back the
basefs of the container. However, this is not needed, as the basefs
is read during container.Mount() anyway, and basefs is only valid
while mounted (and all current calls satisfy this).

This seems minor, but this is actually problematic, as the Get/Put
pair will create a spurious mount/unmount cycle that is not needed and
slows things down. Additionally it will create a supurious
devicemapper activate/deactivate cycle that causes races with udev as
seen in https://github.com/dotcloud/docker/issues/4036.

With this change devicemapper is now race-free, and container startup
is slightly faster.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 0c71015dcf788c5342bb9422a447b7f9ad12d43d
Component: engine
2014-02-11 18:02:30 +01:00
4ce6d81f0d Improve no command handling
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 44821158409d59024173336188e087c605e1da1a
Component: engine
2014-02-10 11:04:24 -08:00
052a914774 Fix integration tests
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 49b9813035b3abb445ef7238f034897fa03a9652
Component: engine
2014-01-31 12:04:44 -08:00
2879fa9100 Fix sending []byte in job env
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 2d8709696c80e992a5b20ba7a00ca3268c57c11c
Component: engine
2014-01-31 12:04:44 -08:00
0b250038dd Update core calls to network drivers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: c712e74b45005e0f38297d254fb606aa18606d11
Component: engine
2014-01-31 12:04:44 -08:00
3044e71de0 Merge pull request #3841 from alexlarsson/separate-base-fs
Separate out graphdriver mount and container root
Upstream-commit: 53ee1daa699ab28fdd37d77b2cfbb0fc14dc0fdb
Component: engine
2014-01-31 11:49:14 -08:00
c5b80fe410 Merge pull request #3718 from alexlarsson/btrfs
Add btrfs support to docker
Upstream-commit: 637a1dcab65c7335d979d42af190a53d9bbea9f7
Component: engine
2014-01-30 10:00:44 -08:00
6d81dd5d9b Separate out graphdriver mount and container root
This separates out the directory as returned from the graphdriver (the
"base" fs) from the root filesystem of the live container. This is
necessary as the "diff" operation needs access to the base filesystem
without all the mounts that the running container needs (/.dockerinit,
volumes, etc).

We change container in the following way:

Container.RootfsPath() returns the the directory which will be used as
the root in a running container. It is always of the form
"/var/lib/docker/container/<id>/root" and is a private bind mount to
the base filesystem. It is only available while the container is running.

Container.BasefsPath() returns the raw directory from the graph driver
without the container runtime mounts. It is availible whenever the
container is mounted (in between a container.Mount()/Unmount() pair,
which are properly refcounted).

This fixes issue #3840

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: fab19d197c6cc362182f6cee4d0a6e65e799875f
Component: engine
2014-01-30 16:43:53 +01:00
1feadd553a Simplify logic for registering ports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: da61b99b392657343df4dc221ba5cd9ad6b1c9e1
Component: engine
2014-01-26 14:01:38 -08:00
225e97e755 Merge pull request #3724 from creack/extract-lxc-phase-2
Refactor process to command
Upstream-commit: 0dd856ee7f636c82e9420ebbd9e2d0b3aeea5136
Component: engine
2014-01-23 15:28:45 -08:00
96dad4beb8 Populate command in ghost state to pass to RestoreCommand
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8723a8a89ec7d5b2a37e0536d7aadd78e5329773
Component: engine
2014-01-22 14:05:01 -08:00
3467e8dad5 Populate Command self cointainer (toward Restore())
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 75e0357d691499b20dc903b702bc44c444f85005
Component: engine
2014-01-22 14:04:55 -08:00
a906461155 Add experimenta btrfs driver
This is an experimental btrfs driver. To use it you must have
/var/lib/docker mounted on a btrfs filesystem and explicitly
specify DOCKER_DRIVER=btrfs in the docker daemon environment.

It works by using subvolumes for the docker image/container layers.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: e51af36a85126aca6bf6da5291eaf960fd82aa56
Component: engine
2014-01-22 21:44:09 +01:00
47913f96e1 Merge pull request #3073 from alexlarsson/refcount-driver-mounts
Refcount driver mounts
Upstream-commit: f61a91f50a753e0b8878675b4bab8ee4dc2a70e1
Component: engine
2014-01-22 11:42:17 -08:00
f30d57c548 Fix wait on stopped container (after docker restart) + add Unit test for that case
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 0376a69cb1cc839f7e1a147623b399147a5976c9
Component: engine
2014-01-21 16:49:24 -08:00
36def61b75 Remove container.EnsureMounted
This was deprecated already and all it did was call Mount().
The use of this was a bit confusing since we need to pair Mount/Unmount
calls which wasn't obvious with "EnsureMounted".

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 191aa17d16c0935a7deda03b4c3bc879f7a316eb
Component: engine
2014-01-21 11:26:11 +01:00
5e35604785 Add Put() to graphdriver API and use it
This makes all users of Put() have a corresponding call
to Get() which means we will be able to track whether
any particular ID is in use and if not unmount it.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: bcaf6c2359d83acd5da54f499e21f4a148f491c5
Component: engine
2014-01-21 11:25:37 +01:00
5b95959a09 Rename Process to Command
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 12468f2bc8a72a6bedfd681084863ea95b48713b
Component: engine
2014-01-20 16:05:07 -08:00
72a4c2e064 Rename Capabilities in sysinfo and move it to its own subpackage
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: crosbymichael)
Upstream-commit: 9e9f4b925b4b6a58a03bbff09150f1314d5fe3b2
Component: engine
2014-01-17 17:42:58 -08:00
ae872300fb Cleanup + add Info to driver in order to have specific IsRunning()
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: crosbymichael)
Upstream-commit: 889b4b10ae3ec1d6e7879c30860aafd7674cb576
Component: engine
2014-01-17 17:42:22 -08:00
ecb354d61e Improve wait for lxc and driver interface
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8c9f62d037a1bc82742ea316adaaf658af56b7c3
Component: engine
2014-01-17 17:42:22 -08:00
28c45914a4 Make exec driver run a blocking command
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f846ecdc77bb9ab4d44b41a2e403bcf579d6b6e9
Component: engine
2014-01-17 17:42:22 -08:00
98268ad2c1 Add chroot driver for testing
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8e0741f5e40d107780a5be1f6ae0f4d30ba43d7d
Component: engine
2014-01-17 17:42:22 -08:00
695537a626 Update with lxc unconfined changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 93ead2fe789a3a94a8433b12efcca782e0a7d7de
Component: engine
2014-01-17 17:42:22 -08:00
a8716549d6 Rework monitor and waitlock inside of driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8e87835968a4c6233406061759e3dca03ab86989
Component: engine
2014-01-17 17:42:22 -08:00
f9406fce53 WIP complete integration test run
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5a3d9bd432fdaa95f870d4d99fad1d6fafeaad92
Component: engine
2014-01-17 17:42:21 -08:00
dc2dffef1c Integrate process changes in container.go
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f2680e5a5b1fc2393dfe319fe4dd197672985411
Component: engine
2014-01-17 17:42:21 -08:00
2514b9eb9b Merge pull request #3420 from RoelVanNyen/getfullname
Cleanup: runtime.getFullName is deprecated by getFullName
Upstream-commit: a0298c0bd070400b4acaad3c2d285037b5875552
Component: engine
2014-01-06 13:59:04 -08:00
0ccbdf155d Extract cgroups utilities to own submodule.
Use mountinfo rather than for cgroups parsing.
Make helper method private and change name.
Makes method naming more explicit rather than GetThisCgroup.
Use upstream term subsystem rather than cgroupType.
Upstream-commit: c561212b837735213f146c2fac291f84dbcbc8c3
Component: engine
2014-01-02 17:54:57 -05:00
bde96d77e1 Cleanup: runtime.getFullName is deprecated by getFullName
Upstream-commit: 9dd7ae4074ecfceb62c3c3eae1811c5bd018c38c
Component: engine
2014-01-02 00:06:50 +01:00
10227320c8 Move utility package 'graphdb' to pkg/graphdb
Upstream-commit: d16d748132330ff58e142472a579d1f6c65e3eac
Component: engine
2013-12-23 23:33:06 +00:00
cf1704f27a Merge pull request #3064 from tianon/custom-dockerinit-path
Allow custom dockerinit path
Upstream-commit: 636dfc82b0c9aaddd5b0f5fb0f70797d5068c93e
Component: engine
2013-12-19 14:31:41 -08:00
dbe3d58b07 Merge pull request #3271 from crosbymichael/mount-outside
Perform docker specific mounts outside of lxc
Upstream-commit: f21bd80e90af12745c7a8bf98d84ec50c3295987
Component: engine
2013-12-19 11:13:31 -08:00
69bf3879ed Move sqlite conn to graph db for cross compile support
Upstream-commit: 329d154209f8da83226e729222dafff4e214b25d
Component: engine
2013-12-18 21:14:16 -08:00
dd4dc32856 Improve interface by moving to subpkg
Enable builds on OSX
Upstream-commit: 7bc96aec7bf978e87cb87935bd55f85e2cb1664a
Component: engine
2013-12-18 16:42:49 -08:00
8eec37c741 Handle external mounts outside of lxc
Upstream-commit: 45d7dcfea276841cce782feced3a2eb3eab01208
Component: engine
2013-12-18 13:46:02 -08:00
766980f441 add some debug to runtime.restore()
Upstream-commit: fde909ffb8e09ae39310093b7389f61aa4ec29df
Component: engine
2013-12-18 10:57:21 -08:00
b6d7266c64 DRY up valid container name pattern usage
Upstream-commit: 3ec39ad01a5823acbb3c4ce49ce5c81258a60815
Component: engine
2013-12-17 20:17:50 -05:00
3c037baf07 Add '.' to valid container name pattern
Upstream-commit: 1940015824f5dabf1e8ffbd0c2b7c09f11f8cdf0
Component: engine
2013-12-17 20:17:06 -05:00
af74b97c6a Always copy dockerinit locally, regardless of whether our docker binary is static, because even it might get deleted or moved/renamed
Upstream-commit: 2035af44aae3664b217d6903cbf39c259f568490
Component: engine
2013-12-16 22:29:00 -07:00
77b832e35d when sharing a /var/lib/docker dir with more than one distribution, an existing lxc-start-unconfined softlink may point to a non-existant path, following that link (as Stat does) will cause the daemon to fail to start
Upstream-commit: 0a3eedd4c9d2bed208a85cd7aefae050a821eb6b
Component: engine
2013-12-14 15:29:08 +10:00
7d30838e63 Merge pull request #3197 from ajhager/3138-names
Validate container names on creation. Fixes #3138
Upstream-commit: a6928e70ace51793c15160e5f7206855abab89ff
Component: engine
2013-12-13 17:28:36 -08:00
db82e5f1c7 Merge pull request #2897 from crosbymichael/aufs-42
Increase max image depth to 127
Upstream-commit: f5ab2516d8d50c2ef756fe92d7218bc3248d714a
Component: engine
2013-12-13 16:03:57 -08:00
acf919be05 Validate container names on creation. Fixes #3138
Move valid container name regex to the top of the file

Added hyphen as a valid rune in container names.

Remove group in valid container name regex.
Upstream-commit: f63cdf0260cf6287d28a589a79d3f947def6a569
Component: engine
2013-12-13 14:14:05 -05:00
738aed6186 If container does not exist try to remove the name and continue
Upstream-commit: 7bf3a07371bb0baed21b59d60835ed2f4877b571
Component: engine
2013-12-05 15:22:21 -08:00