Commit Graph

117 Commits

Author SHA1 Message Date
ba77c9041d refactor(libcontainer): rename to CapabilitiesMask
The Capabilities field on libcontainer is actually used as a mask.
Rename the field so that this is more clear.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
Upstream-commit: 128381e0f0372f10f88a847087aa91a972770c4b
Component: engine
2014-03-17 11:07:12 -07:00
746b307c72 Move all bind-mounts in the container inside the namespace
This moves the bind mounts like /.dockerinit, /etc/hostname, volumes,
etc into the container namespace, by setting them up using lxc.

This is useful to avoid littering the global namespace with a lot of
mounts that are internal to each container and are not generally
needed on the outside. In particular, it seems that having a lot of
mounts is problematic wrt scaling to a lot of containers on systems
where the root filesystem is mounted --rshared.

Note that the "private" option is only supported by the native driver, as
lxc doesn't support setting this. This is not a huge problem, but it does
mean that some mounts are unnecessarily shared inside the container if you're
using the lxc driver.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 6c266c4b42eeabe2d433a994753d86637fe52a0b
Component: engine
2014-03-13 20:01:29 +01:00
1cf50c0291 Move .dockerenv parsing to lxc driver
This is not needed for e.g. the native driver

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 636959e20ae368e470a5c2420aae4528245b2cf6
Component: engine
2014-03-13 20:01:29 +01:00
909b6bf3f3 Update parseLxcInfo to comply with new lxc1.0 format
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: fd0737df2c8ec8f0a4b4d8f20b2ad6e4c96adbd3
Component: engine
2014-03-11 12:08:32 -07:00
4be803250c Remove goroutine leak upon error
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: 721562f29685ebf3f3698113cf0ce8000c02e606
Component: engine
2014-03-11 11:39:28 -07:00
27ee8116cc Merge pull request #4589 from creack/update_maintainer
Update MAINTAINER email + add self to pkg/signal MAINTAINER
Upstream-commit: 0a6d9035cf37e567e4573fce5ac4b192c21abf47
Component: engine
2014-03-11 10:18:37 -07:00
57e56c8558 Move execdriver construction into execdriver/execdrivers
This can't be in execdriver (dependency loop) but should not be
hardcoded inside runtime.go either. So we put it in a subpackage.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 07c35b41a5a93f31111d47afcb1e6d2926b492a0
Component: engine
2014-03-11 16:37:19 +01:00
84def4f523 Update email + add self to pkg/signal
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: 915d967f556bc7bb3faea34db8a06ea64fd5de92
Component: engine
2014-03-10 20:26:45 -07:00
957f74b876 Add env var to toggle pivot root or ms_move
Use the  DOCKER_RAMDISK env var to tell the native driver not to use
a pivot root when setting up the rootfs of a container.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 36dd124b16a76704a88142fa96bb4bb6260dd821
Component: engine
2014-03-06 19:30:52 -08:00
fe7e822dde Merge pull request #4509 from crosbymichael/kill-all
Remove the ghosts and kill everything
Upstream-commit: 1695c77c436e65a9f553b365714b56f78891bef5
Component: engine
2014-03-07 01:35:38 +02:00
936f96cce5 Remove the ghosts and kill everything
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 772ef99d2816b629d084e11fe7fba5953687b620
Component: engine
2014-03-06 15:30:26 -08:00
1f7c2a04c8 Merge pull request #4488 from crosbymichael/return-correct-lxc-pid
Return correct process pid for lxc
Upstream-commit: e4ebe6a12f5067602ab76aa0763dc4b291e5046f
Component: engine
2014-03-07 00:14:08 +02:00
098ea0f413 libcontainer: Don't use UsetCloseOnExec, it is racy
We can't keep file descriptors without close-on-exec except with
syscall.ForkLock held, as otherwise they could leak by accident into
other children from forks in other threads.

Instead we just use Cmd.ExtraFiles which handles all this for us.

This fixes https://github.com/dotcloud/docker/issues/4493

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 5c9b28db1853cccdf7a1037eeaad372d12cd68fa
Component: engine
2014-03-06 14:10:32 +01:00
e217c314a6 Return correct process pid for lxc
Fixes #2875
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 69e3d30bb6c5082aff2a7d5eafaf562e59246a49
Component: engine
2014-03-05 18:02:19 -08:00
50624219ad Generate and load custom docker profile for apparmor
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 920a6ca54ce98673d0c9a6a9502a469c1c225c75
Component: engine
2014-03-05 15:02:11 -08:00
c1e434e543 Add AppArmor support to native driver + change pipe/dup logic
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: cb4189a292dc181e26e0506a3a0dc67936c5401b
Component: engine
2014-03-05 13:08:24 -08:00
7cf0d3e449 Add missing -- when we run dockerinit from native
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: c987901f8d64ab2390409018074b2f93c1718e89
Component: engine
2014-03-05 20:26:48 +00:00
d321be3c28 Change veth prefix back to veth
Fixes #4453
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 0cdf10263844db0cb4d051ac9f79051104abe77f
Component: engine
2014-03-04 11:46:05 -08:00
dc4d93c655 Merge pull request #4327 from crosbymichael/add-libcontainer
Add native execution driver to docker and make it the default
Upstream-commit: 69c69059fc3933531e19c05a9d2e831fb713881c
Component: engine
2014-03-03 16:34:20 -08:00
efaa1f688a fix docker info with lxc 1.0.0
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: f30f823bf50de6581f547aee842286584c4b6990
Component: engine
2014-02-28 00:32:58 +00:00
4bb07a86b5 Ensure that ticker does not leak
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 44c3b7133218a66f44cb51b7563b7c0016583eda
Component: engine
2014-02-27 11:40:25 -08:00
49fbe66f4f Allow child process to live if daemon dies
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: fdeea90fc806d8d2cccdc76a6ecb214dd03093ec
Component: engine
2014-02-27 09:33:36 -08:00
9c9bdcb0ef Ensure that the container dir is remove on restore
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a115ce797b80a14d268fcd96521cf05d1e1074c1
Component: engine
2014-02-27 08:28:55 -08:00
02cbc6e6b4 Code review updates
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: fb08b8b221a9a722910d63db678ffb5a8f91b517
Component: engine
2014-02-26 19:21:46 -08:00
3258d9a2a3 Make network a slice to support multiple types
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 70820b69ec2b82ab150af9b8829e37843f67f75a
Component: engine
2014-02-26 14:20:41 -08:00
bec84fb562 Merge branch 'master' into add-libcontainer
Conflicts:
	execdriver/termconsole.go

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: ce08083f9cd23e8f5e44228b0b73884bcf2f3562
Component: engine
2014-02-26 12:55:24 -08:00
c5ba66b375 Merge pull request #4282 from ibuildthecloud/jumbo-frames
Add MTU to lxc conf to make host and container MTU match
Upstream-commit: 22da8cdc7e862dbc54806dc935f4ef079be22654
Component: engine
2014-02-26 20:11:38 +02:00
360444d431 Merge pull request #4308 from vbatts/vbatts-seperate_driver_term
seperate out the terminal functions from lxc
Upstream-commit: d8b60cb5929b35d35695708ffb8595bc55d2b37f
Component: engine
2014-02-26 16:58:21 +02:00
514380823f Return error for lxc-conf when using native driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: bfdf07ac98e1a425892b787cf224109d5925a798
Component: engine
2014-02-25 17:13:00 -08:00
cdfec9fd8a Ensure that the container's dir is remove from native driver on stop
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5c67d2e6346d493e2b8b0469d453a64d41c22cb2
Component: engine
2014-02-25 16:27:07 -08:00
9248431c6a Fix cross compile for make cross
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 93ed15075c43d521f05f4b8f96264efb7fe174e4
Component: engine
2014-02-25 15:19:13 -08:00
0cd1a2f6a4 Move container.json and pid file into a root specific driver dir
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 96e33a7646b3669632f48ed1071aeb61b8016be1
Component: engine
2014-02-25 12:41:31 -08:00
28bf2a10c1 Merge branch 'add-libcontainer' of https://github.com/crosbymichael/docker into add-libcontainer
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: ca42758368b7bd8e6b102411531c2c89356407ad
Component: engine
2014-02-25 11:42:15 -08:00
1bd3fbfadf Address initial feedback from pr
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: de083400b8d7c2074d71a30a92e4f3c8bcd8bad8
Component: engine
2014-02-25 10:54:41 -08:00
fbca607ce0 correcting the package name for the terminal setup
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: c35853191ccd9ca8fe91b666d598eac3e4e12c67
Component: engine
2014-02-25 10:07:06 -05:00
a70a6bdd53 Better capability/namespace management
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
Upstream-commit: 91bf120c51dec3bae98a1974929e2ae8107340c0
Component: engine
2014-02-24 21:52:29 -08:00
9649d5107a Remove container env var from libcontainer
Update tests to use native driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 431d510cae85bc1265c861028dd9751ae95088b2
Component: engine
2014-02-24 21:51:00 -08:00
cd79f65fb0 Move types around in native driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8db740a38e333158e613bc5b3a7acc2605131581
Component: engine
2014-02-24 21:21:35 -08:00
0460b2181f Refactor and improve libcontainer and driver
Remove logging for now because it is complicating things
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f8453cd0499a51f5d3ffd2c2a6012972aef7f69f
Component: engine
2014-02-24 21:11:52 -08:00
530d80759d Fix exec driver flag, rename new driver to 'native'
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d59c05a37c3e964cdeef818afc2e7c3a3e8d0cf1
Component: engine
2014-02-24 20:41:09 -08:00
4f321caf5c Merge branch 'master' into add-libcontainer
Conflicts:
	runtime.go

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 27a43692c2b114ed9b6418e75d16cbb2e6c7a993
Component: engine
2014-02-24 20:35:12 -08:00
4d05a25973 Remove chroot driver, it's not needed
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: ca537a63a8a21eb4d5d31144c934ca18846bb856
Component: engine
2014-02-24 18:52:48 -08:00
3dcdf3e0d6 Improve logging for nsinit
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 9cb4573d33607bc32e7db19981b3e9d5eaf449a0
Component: engine
2014-02-24 18:38:36 -08:00
f6bf4c8510 Rename namespace driver to docker
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 77f68f74c7e6fc977fb2681c7ee60ac652be983e
Component: engine
2014-02-24 16:42:30 -08:00
b697db52c8 Fix restore container by nspid
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 9f03fd76b578f2d9d00b0a1bd76b776e20a7d681
Component: engine
2014-02-24 16:35:11 -08:00
471c8027da Fix get pids for nsinit
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 9bf6cb2692a9b14cac559b4b9c9403e7f6f13ecd
Component: engine
2014-02-24 16:26:06 -08:00
aef5af9f3c Cgroups allow devices for privileged containers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a76407ac61dd57429a1350f840c323f45a97b27f
Component: engine
2014-02-24 15:47:23 -08:00
57d4919fc6 Fix kill signals and rootfs path for pid
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a6e5e1851197ccc262c61190d5904dd410293466
Component: engine
2014-02-24 14:35:27 -08:00
4c203f5a85 Add info for driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: cfd188e9251f5047e4fd677fe8f2921ae28b8bcc
Component: engine
2014-02-24 14:11:09 -08:00
8a923765fc Use the cpu cgroup subsystem instead of memory because its non optional
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 757c7581c8334b6b527d1c922fe5007d5004eca2
Component: engine
2014-02-24 13:42:13 -08:00