Commit Graph

114 Commits

Author SHA1 Message Date
74f0d78beb Enable construction of TruncIndex from id array.
Fixes #5166

Current graph.restore is essentially O(n^2 log n) due to how
suffixarray creation works.

Rather than create/append/create new this supports creation from a seed
array of ids.

Functional testing shows this eliminates the hang on Creating image
graph reported on list.

Docker-DCO-1.1-Signed-off-by: Paul Nasrat <pnasrat@gmail.com> (github: pnasrat)
Upstream-commit: 4f169c2db512d2ea9ed5729df375896a1ee90347
Component: engine
2014-04-11 16:39:58 -04:00
8a00f43f92 bridge driver: clean up error returns
Docker-DCO-1.1-Signed-off-by: Daniel Norberg <daniel.norberg@gmail.com> (github: danielnorberg)
Upstream-commit: d4746d3ea0b8d4888b21b808237199ae22525b07
Component: engine
2014-04-10 11:26:48 -04:00
6bee2b968e net: do not create -b/--bridge specified bridge
If the bridge specified using -b/--bridge doesn't
exist, fail instead of attempting to create it.

This is consistent with the docker documentation
on -b/--bridge: "Attach containers to a pre
existing network bridge". 

It is also less surprising in an environment where
the operator expected the bridge to be properly
set up before docker starts and expects docker to
fail fast if the bridge was not up instead of
masking this error and coming up in some
potentially broken state.

With this patch, docker still creates docker0 if
needed and no bridge was explicitly specified.

Docker-DCO-1.1-Signed-off-by: Daniel Norberg <daniel.norberg@gmail.com> (github: danielnorberg)
Upstream-commit: 336199a877014143bac462e98cae7f59525a0556
Component: engine
2014-04-10 11:11:17 -04:00
7d69f5cd99 Check for apparmor enabled on host to populate profile
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 87f0d63fb2ede63d263d8e8285b83a7f7d12bbf3
Component: engine
2014-04-09 10:22:17 +00:00
7de0d1325f Make volumes-from a slice instead of string split
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: b4f2821e6d4ba6f6073365a244681df21f5d4472
Component: engine
2014-04-08 21:45:06 +00:00
ecfa4893ce Move volumesfrom to hostconfig
This also migrates the volumes from integration tests into the new cli
integration test framework.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: af9746412b6070063f105ae97eba1f8fbd56bd22
Component: engine
2014-04-08 21:45:06 +00:00
6ef9e84239 Merge pull request #5089 from creack/replace_existing_docker_apparmor_profile
Backup current docker apparmor profile and replace it with the new one
Upstream-commit: 9839688db3f3470f71ea14f3f418cbb2300e6732
Component: engine
2014-04-08 14:36:11 -07:00
352a05bd56 Merge pull request #5066 from crosbymichael/remove-dns-conf
Move DNS options to hostconfig
Upstream-commit: 795d6b8b150db03c62403ab5fbefa5ca7488c2bf
Component: engine
2014-04-08 13:44:26 -07:00
c2ee8e861a Backup current docker apparmor profile and replace it with the new one
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: 4f828d67f00449182eaada50dfba37e00f8f01ef
Component: engine
2014-04-08 11:09:31 -07:00
af8f9d4096 Fix edge case in bind mount absolute path detection
`filepath.Abs` does more than just `filepath.IsAbs` - namely, `filepath.Clean`, which resolves things like `.../.` or `.../../...`, and causes even an absolute path like `/some/path/../absolute` to fail (or, in my case, `/path/to/docker/.`)

Just using `filepath.IsAbs` directly is a much cheaper check, too. :)

Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: 603088be928564be2d863a897fbc1729adc74814
Component: engine
2014-04-07 21:20:03 -06:00
7f3a663aad Move DNS options to hostconfig
The local resolver warning needed to be moved at daemon start because it
was only show for the first container started anyways before having a
default value set.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 919dbbe44df0722ca35538223a9c89e71856ec88
Component: engine
2014-04-07 19:12:22 -07:00
3a7c03a563 Ensure that selinux is disabled by default
This also includes some portability changes so that the package can be
imported with the top level runtime.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 82f37b874ea17c5e0040f3e41dc761c88d576e33
Component: engine
2014-04-07 14:44:53 -07:00
84a11b7762 Move -o cli flag and DriverConfig from HostConfig
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: ffebcb660f666e3a2a7be6b838ebd55f524d5b5d
Component: engine
2014-04-07 14:44:52 -07:00
8770121953 Clean runtime create and make it simple
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 1277885420b069abd7468fe3e69deb4fb0a3f4fc
Component: engine
2014-04-07 12:20:23 -07:00
786c7662ab Move history to separate file
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: c987aa09d81a6916e3893c41b7ec2880570b5c65
Component: engine
2014-04-07 11:01:35 -07:00
bd428c83dc Remove driver wide mount label for dm
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8b450a93b8bb3b1cd0c32754dd499ec0c9b66537
Component: engine
2014-04-03 06:34:57 +00:00
91572b0294 Remove runtime options from config
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: e2779e11db113c5551094dba8079d44d8a210e41
Component: engine
2014-04-03 04:40:38 +00:00
7270524938 Fix lxc label handleing
This also improves the logic around formatting the labels for selinux
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 94233a204f82f857536c16f36f94d3a8ff0069dd
Component: engine
2014-04-02 16:52:49 +00:00
f5030a0a05 Merge branch 'selinux' of https://github.com/rhatdan/docker into rhatdan-selinux
Conflicts:
	pkg/selinux/selinux.go
	runtime/execdriver/lxc/lxc_template.go

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 6e7a93628b924d176a9caa1164db7a1526dbe573
Component: engine
2014-04-02 16:11:35 +00:00
7ca727547c Fix SELinux issue with missing Contexts in lxc execdriver
There is a bug in the SELinux patch for the lxc execdriver, that
causes lxc containers to blow up whether or not SELinux is enabled.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: ca4224762b5fe9a319b6c1724ee16d1552403269
Component: engine
2014-04-03 09:45:40 -04:00
e732ee3fcd Fix configuration test for MKNOD
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f80fd5da09013d7cd25a0f246ffffd7b6c064073
Component: engine
2014-04-02 13:07:11 +00:00
42964a36b7 Allow non-privileged containers to create device nodes.
Such nodes could already be created by importing a tarball to a container; now
they can be created from within the container itself.

This gives non-privileged containers the mknod kernel capability, and modifies
their cgroup settings to allow creation of *any* node, not just whitelisted
ones.  Use of such nodes is still controlled by the existing cgroup whitelist.

Docker-DCO-1.1-Signed-off-by: Kevin Wallace <kevin@pentabarf.net> (github: kevinwallace)
Upstream-commit: c94111b61988ad32d87f99d4421cbcde018c3fb4
Component: engine
2014-04-03 18:44:13 +00:00
ba88c545d8 Fix --volumes-from mount failure
As explained in https://github.com/dotcloud/docker/issues/4979
--volumes-from fails with ENOFILE errors.

This is because the code tries to look at the "from" volume without
ensuring that it is mounted yet. We fix this by mounting the containers
before stating in it.

Also includes a regression test.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: bd94f84ded944ab69c18cf9d23c35deee3b15963
Component: engine
2014-04-03 19:33:20 +02:00
98d864eefe devmapper: Avoid AB-BA deadlock
We currently drop the global lock while holding a per-device lock when
waiting for device removal, and then we re-aquire it when the sleep is done.
This is causing a AB-BA deadlock if anyone at the same time tries to do any
operation on that device like this:

thread A:             thread B
grabs global lock
grabs device lock
releases global lock
sleeps
                      grabs global lock
                      blocks on device lock
wakes up
blocks on global lock

To trigger this you can for instance do:

ID=`docker run -d fedora sleep 5`
cd /var/lib/docker/devicemapper/mnt/$ID
docker wait $ID
docker rm $ID &
docker rm $ID

The unmount will fail due to the mount being busy thus causing the
timeout and the second rm will then trigger the deadlock.

We fix this by adding a lock ordering such that the device locks
are always grabbed before the global lock. This is safe since the
device lookups now have a separate lock.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 2ffef1b7eb618162673c6ffabccb9ca57c7dfce3
Component: engine
2014-04-02 09:05:00 +02:00
bd0bcefa7f devmapper: Add lock to protext Devices map
Currently access to the Devices map is serialized by the main
DeviceSet lock, but we need to access it outside that lock, so we
add a separate lock for this and grab that everywhere we modify
or read the map.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 70826e8b3fee27b971852aad89053507c6866d3e
Component: engine
2014-04-02 09:05:00 +02:00
1544c3baed devmapper: Add lookupDevice() helper
This centralizes the lookup of devices so it is only done in one place.
This will be needed later when we change the locking for it.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: e01b71cebeb96755641a18762dea5b843f107bee
Component: engine
2014-04-02 09:05:00 +02:00
be8cb2a3bc devmapper: Pass info rather than hash to setInitialized
We already have this at the caller, no need to look up again.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 74edcaf1e84aa8bf35e496b2bead833172a79fca
Component: engine
2014-04-02 09:05:00 +02:00
3fc0d17ed6 devmapper: Pass info rather than hash to deactivateDevice()
We already have the info in most cases, no need to look this up multiple times.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 5955846774c9b43291d6de0584fa8c3f62414c43
Component: engine
2014-04-02 09:05:00 +02:00
cca3f27ce9 devmapper: Pass info rather than hash to deleteDevice
All the callers already have the info, no need for an extra lookup.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 8e39b35c7cd02bbb644b7faf2a434de0098e6dea
Component: engine
2014-04-02 09:05:00 +02:00
d51d0846f3 devmapper: Pass info rather than hash to activateDeviceIfNeeded
There is no need to look this up again, we have it already in all callers.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: e5394e35c7a8f730ac76d24dee74d769049a0428
Component: engine
2014-04-02 09:05:00 +02:00
d7e849e505 Merge pull request #4931 from crosbymichael/gen-mac-addr-for-bridge
Set bridge mac addr on supported kernels
Upstream-commit: ceed9382d0b361018a57ec96e163c3c30198cbd0
Component: engine
2014-04-02 02:47:56 +03:00
4675670b52 Merge pull request #4867 from crosbymichael/clean-shutdown
Cleanly shutdown docker
Upstream-commit: 30ff3fa954676bfc8f48b73093f3afa1473d146e
Component: engine
2014-04-02 01:48:03 +03:00
45bf7e9540 Update test to reallocate port
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 6b7cfc9e95af8510abc801a02cda7879e4f82518
Component: engine
2014-04-01 07:27:34 +00:00
f2838447fa Merge pull request #4949 from tjmehta/4908-fix_dynamic_port_allocation_limit
Fix dynamic port allocation limit
Upstream-commit: 7462cc6479c3a5c2f572bf9fe2bfc60a4f1e2506
Component: engine
2014-04-01 13:49:21 -07:00
b924033920 Merge pull request #4833 from crosbymichael/pluginflag
Add opts flag for fine grained control over drivers
Upstream-commit: b4b87413d8d3fd20073975bcc84603fa7853d316
Component: engine
2014-04-01 13:34:08 -07:00
e4f0a4813f Do not error when trying to start a started container
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: a03f83e3370f3859ebff172d504cc29817863b17
Component: engine
2014-04-01 10:26:53 -07:00
2ec7753394 Send sigterm and wait forever
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 93779cc7fee4ee0690d9dd28eed478a418e79577
Component: engine
2014-04-01 07:12:50 +00:00
8169d6ecd6 Ensure state is saved to disk after we kill the ghost
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: e36d89b0f9c8ba5b071374310ca632f6b2fdb7a1
Component: engine
2014-04-01 07:12:50 +00:00
5f13c09028 Ensure a reliable way to kill ghost containers on reboot
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5bb82f6313d7f789783ffac854be85a44a56617e
Component: engine
2014-04-01 07:11:41 +00:00
b36db3b674 Add kill for other drivers on restart
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5b9069bd990dca0a35d8e490c6f6b56d27163bb8
Component: engine
2014-04-01 07:11:41 +00:00
357e0a3599 Ensure that all containers are stopped cleanly at shutdown
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f067e263677fc86f9610ca61fbe42f63efad91f2
Component: engine
2014-04-01 07:11:41 +00:00
0595bffeac Update imports to be consistent
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 40c6d00c97c737d9d3827f159518007803affcc7
Component: engine
2014-04-01 07:07:42 +00:00
69f1eddd56 make findNextPort circular, add all-ports-allocated error
Docker-DCO-1.1-Signed-off-by: Tejesh Mehta <tejesh.mehta@gmail.com> (github: tjmehta)
Upstream-commit: 739d1244807bc3522a0af4dc3490305d6f037601
Component: engine
2014-03-31 22:21:52 -07:00
a4e4b56b6e Set bridge mac addr on supported kernels
Fixes #3200
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 4cdcea20474a9f42291fe6b6c6dee348343a7c05
Component: engine
2014-03-31 22:56:23 +00:00
91181125c8 Force abs paths for host volumes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 904bf049c1626567ee28a21bde4b68ab82c5ce77
Component: engine
2014-03-31 19:10:19 +00:00
cbbfe30c09 Allow volumes from to be individual files
Fixes #4741
Right now volumes from expected a dir and not a file so when the drivers
 tried to do the bind mount, the destination was a dir, not a file so it
 fails to run.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a57900e35f2c30026a070fdfdbdb0ce99b35e1ff
Component: engine
2014-03-31 17:27:38 +00:00
9b7d158e2c Merge pull request #4884 from rhatdan/remount-var-lib-docker
Remount /var/lib/docker as --private to fix scaling issue
Upstream-commit: c705e4a80bd93fac7af38f5384ca61cb884bd22f
Component: engine
2014-03-28 17:15:32 -07:00
8d7581c203 devmapper: Ensure we shut down thin pool cleanly.
The change in commit a9fa1a13c3b0a654a96be01ff7ec19e8009b2094
made us only deactivate devices that were mounted. Unfortunately
this made us not deactivate the base device. Which caused
us to not be able to deactivate the pool.

This fixes that by always just deactivating the base device.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 66c5e19f9bd057644fab475499ea45bb428ba2b2
Component: engine
2014-03-28 15:58:14 +01:00
6d04587343 Remount /var/lib/docker as --private to fix scaling issue
If an admin mounts all file systems as -rshared (Default on RHEL and Fedora)
we see a scaling problem as the number of container increase.

Basically every new container needs to have it new mounts in /var/lib/docker
shared to all other containers, this ends up with us only able to scale to
around 100 containers, before the system slows down.

By simply bind mounting /var/lib/docker on its and then setting it private,
the scaling issue goes away.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 792bb41e524615486ef8266b7bf4804b4fe178f1
Component: engine
2014-03-28 09:19:21 -04:00
da6de365f6 Merge pull request #4450 from alexlarsson/cgroups-systemd
Add systemd implementation of cgroups
Upstream-commit: 69ba31e17ea4dab6b040478720955dece5986f6c
Component: engine
2014-03-28 03:05:02 +02:00