Commit Graph

49 Commits

Author SHA1 Message Date
c77458bef6 Update libcontainer to 1597c68f7b941fd97881155d7f077852e2914e7b
This commit contains changes for docker:
* user.GetGroupFile to user.GetGroupPath docker/libcontainer#301
* Add systemd support for OOM docker/libcontainer#307
* Support for custom namespaces docker/libcontainer#279, docker/libcontainer#312
* Fixes #9699 docker/libcontainer#308

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 50905a6d6ce2fdd1ab0c33ec0b7a26895e0cbeea
Component: engine
2014-12-23 12:10:03 -08:00
09b8238fe6 Allow IPC namespace to be shared between containers or with the host
Some workloads rely on IPC for communications with other processes.  We
would like to split workloads between two container but still allow them
to communicate though shared IPC.

This patch mimics the --net code to allow --ipc=host to not split off
the IPC Namespace.  ipc=container:CONTAINERID to share ipc between containers

If you share IPC between containers, then you need to make sure SELinux labels
match.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 497fc8876ede9924f61c0eee4dfadd71e5d9f537
Component: engine
2014-11-12 11:29:58 -05:00
4418404026 Support for consistent MAC address.
Right now, MAC addresses are randomly generated by the kernel when
creating the veth interfaces.

This causes different issues related to ARP, such as #4581, #5737 and #8269.

This change adds support for consistent MAC addresses, guaranteeing that
an IP address will always end up with the same MAC address, no matter
what.

Since IP addresses are already guaranteed to be unique by the
IPAllocator, MAC addresses will inherit this property as well for free.

Consistent mac addresses is also a requirement for stable networking (#8297)
since re-using the same IP address on a different MAC address triggers the ARP
issue.

Finally, this change makes the MAC address accessible through docker
inspect, which fixes #4033.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
Upstream-commit: 88e21c6a75310da158bbee3a5fdc135697c93ba1
Component: engine
2014-10-03 13:22:38 -07:00
1df0784591 Merge pull request #8299 from vieux/pr_7425
Add --security-opts options to allow user to customize container labels and apparmor profile
Upstream-commit: d40ab6f1238c78ea84645e516f1f24d7991798b0
Component: engine
2014-09-30 17:53:11 -07:00
f73d9c3630 add apparmor:
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: c2c5e57a8ea4b1dc35c58654443a8c4508277904
Component: engine
2014-09-30 00:43:47 +00:00
b79cf494d2 Merge pull request #8293 from crosbymichael/update-libcontainer-sep8
Update libcontainer to c744f6470e37be5ce1f1ae09b842c15c1bee120d
Upstream-commit: 07179a7eb1a0cb7816b618a108d46cb4a4e699ca
Component: engine
2014-09-29 18:09:25 -06:00
280ec2913c Strongly type exec driver context
This also removes dead code in the native driver for a past feature that
was never fully implemented.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 32dca1a7b0e800d796e54fc8f253818ba64fa075
Component: engine
2014-09-29 22:40:26 +00:00
1b12783c0c Update native driver to set RootFs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 532c29ef7deea38bed68506b785f067796a1836b
Component: engine
2014-09-29 21:35:25 +00:00
d8cb453d89 Allow /etc/hosts and /etc/resolv.conf to be updated both outside and
inside the container.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 09b700288e4804162ef86c99466e08b6b016e0c4
Component: engine
2014-09-13 11:27:34 -07:00
0886b9cbe5 Update mount struct with reference
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 688741df31396ece5f72cbc5ecc0250b3d06a8bc
Component: engine
2014-09-01 15:18:30 -07:00
a7e2cb4124 Refactoring execdriver.Command and Container structs to support 'docker exec' and other
similar features in the future.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 4aa5da278f49c889d43191f82ff42d3a95266d62
Component: engine
2014-09-01 14:30:16 -07:00
2273fb0f55 gofmt -s -w
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 5a0ef08c940b9a17c400389bca8e7f54935ceba9
Component: engine
2014-07-24 22:25:29 +00:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
f48be61b0a Fix cross compile non cgo and linux systems
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
Upstream-commit: 7a8ea91392e0cc97caf2a6edc3b262b33a5b446d
Component: engine
2014-07-16 16:57:49 -07:00
ad74ef7753 Update native driver for libcontainer changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
Upstream-commit: f00e64357672ea3a130b2570ce34ea48ad51bbb5
Component: engine
2014-07-14 12:49:50 -07:00
e7f2c9317d add check for invalid caps
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: c04230c42b7a953ffe50bc37d351f86e80a442e6
Component: engine
2014-07-11 23:43:21 +00:00
2032a7ad93 small refactoring
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f3ff323fb364495617de3e43f2d09a145a4f2ee3
Component: engine
2014-07-11 23:43:21 +00:00
ca489c2f49 Basic --cap-add and --cap-drop support for native
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 94e6dc978134b61a2b30aa9118f98f6fadd10535
Component: engine
2014-07-11 23:43:21 +00:00
68391774fe Update libcontainer Context changes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
Upstream-commit: c9fdb08bdafb90b76cfa804b079d2e446a3503e4
Component: engine
2014-06-26 16:56:39 -07:00
0daa61f085 Rename libcontainer.Container to libcontainer.Config
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
Upstream-commit: 1dc8e2ffab795f4999a122b4a576d54e03c7c61a
Component: engine
2014-06-24 11:31:03 -07:00
d4e9300e80 Update libcontainer references
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
Upstream-commit: cee6f4506c79c6fc21769d427ac4dd51c28450c3
Component: engine
2014-06-24 11:31:03 -07:00
52b8a282c3 Update libcontainer imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 8194556337b65dda71a3d4d7f6ae9653ad5a19a0
Component: engine
2014-06-10 19:58:15 -07:00
b00f7d0626 Gofmt imports
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: bae6a5a616cfc382f45a25af13633681875ddff0
Component: engine
2014-06-09 16:01:57 -07:00
3c7670e68c Move libcontainer deps into libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 6158ccad97db51e756aafefb096d1163aa4d6439
Component: engine
2014-06-09 15:52:12 -07:00
3248c6e81c Ensure all dev nodes are copied for privileged
This also makes sure that devices are pointers to avoid copies
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 69989b7c06b0ca6737e83ddf8fcfa2dfccc57a7c
Component: engine
2014-05-30 18:39:11 -07:00
bc9024a72e Merge pull request #6097 from timthelion/consistentdevices
Refactor device handling code
Upstream-commit: 0ef637722f69cff931b25c75d421e231ab75af75
Component: engine
2014-05-31 03:34:52 +03:00
52c8a31f21 Refactor device handling code
We now have one place that keeps track of (most) devices that are allowed and created within the container.  That place is pkg/libcontainer/devices/devices.go

This fixes several inconsistencies between which devices were created in the lxc backend and the native backend.  It also fixes inconsistencies between wich devices were created and which were allowed.  For example, /dev/full was being created but it was not allowed within the cgroup.  It also declares the file modes and permissions of the default devices, rather than copying them from the host.  This is in line with docker's philosphy of not being host dependent.

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
Upstream-commit: 608702b98064a4dfd70b5ff0bd6fb45d2429f45b
Component: engine
2014-05-30 19:21:29 +00:00
57a9b63e5e Fix race in native driver on activeContainers usage
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: 64bd6a6a5342c87db7096f60365d270d0d69e9d2
Component: engine
2014-05-30 14:16:00 +04:00
f41d7794be Merge pull request #5976 from crosbymichael/getpids
Move get pid into cgroup implementation
Upstream-commit: 55d41c3e21e1593b944c06196ffb2ac57ab7f653
Component: engine
2014-05-21 19:09:50 -07:00
189f43a3ba Move get pid into cgroup implementation
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 811d93326bc2d9451eb444e2343bb3063611de7a
Component: engine
2014-05-21 21:14:07 +00:00
37f08c7066 Update code post codereview
Add specific types for Required and Optional DeviceNodes
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f042c3c15759fce5cc139f2b3362b791ac7d4829
Component: engine
2014-05-21 00:40:41 +00:00
ada6c057b6 Mount /dev in tmpfs for privileged containers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 34c05c58c8d41ee2bb02cd8059e9928ee2f061ea
Component: engine
2014-05-20 22:51:24 +00:00
e3742d2641 Make libcontainer's CapabilitiesMask into a []string (Capabilities).
Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
Upstream-commit: 92614928cecd48b241011e614fa856c4fdbac1f6
Component: engine
2014-05-17 00:44:10 +00:00
4926e35bb1 Add cpuset cpus support for docker
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: adbe3096e8c8572925dbae5f19ac2ce2dc84fb1c
Component: engine
2014-05-13 18:17:12 -07:00
df4270e3f2 Update after namespace refactor
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 01fec73ba4cff45ac08c0330ea0d67aff70ebf8e
Component: engine
2014-05-05 13:56:18 -07:00
d5f89ec02b Merge pull request #4441 from crosbymichael/add-net-flag
Add --net flag to docker run and allow host network stack
Upstream-commit: 70fef1460a9d253bdf164d70d7057ec4ee497e08
Component: engine
2014-05-05 13:54:55 -07:00
41f42a620b Improve libcontainer namespace and cap format
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: db5f6b4aa0b34adbc9ba189a042e77e7bcdee681
Component: engine
2014-05-05 12:34:21 -07:00
0fcf738183 Setup host networking for lxc and native
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a785882b29b9f0b24ace8249576c5d8d7f8c1d94
Component: engine
2014-05-05 10:08:59 -07:00
381004dc30 runconfig: add -net container:name option
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: a60159f3b102244fc5470642bd32eb99d5ac329c
Component: engine
2014-05-05 10:08:59 -07:00
17870b6e20 Update restrictions for better handling of mounts
This also cleans up some of the left over restriction paths code from
before.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f5139233b930e436707a65cc032aa2952edd6e4a
Component: engine
2014-05-01 15:26:58 -07:00
7dc5aa24f0 Mount /proc and /sys read-only, except in privileged containers.
It has been pointed out that some files in /proc and /sys can be used
to break out of containers. However, if those filesystems are mounted
read-only, most of the known exploits are mitigated, since they rely
on writing some file in those filesystems.

This does not replace security modules (like SELinux or AppArmor), it
is just another layer of security. Likewise, it doesn't mean that the
other mitigations (shadowing parts of /proc or /sys with bind mounts)
are useless. Those measures are still useful. As such, the shadowing
of /proc/kcore is still enabled with both LXC and native drivers.

Special care has to be taken with /proc/1/attr, which still needs to
be mounted read-write in order to enable the AppArmor profile. It is
bind-mounted from a private read-write mount of procfs.

All that enforcement is done in dockerinit. The code doing the real
work is in libcontainer. The init function for the LXC driver calls
the function from libcontainer to avoid code duplication.

Docker-DCO-1.1-Signed-off-by: Jérôme Petazzoni <jerome@docker.com> (github: jpetazzo)
Upstream-commit: 1c4202a6142d238d41f10deff1f0548f7591350b
Component: engine
2014-05-01 15:26:58 -07:00
2acb87c29f Initial work on selinux patch
This has every container using the docker daemon's pid for the processes
label so it does not work correctly.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f0e6e135a8d733af173bf0b8732c704c9ec716d7
Component: engine
2014-04-29 03:40:05 -07:00
f2b5fc4e3c Merge pull request #5411 from crosbymichael/lockdown
Update default restrictions for exec drivers
Upstream-commit: 44140f7909ac65206d300fa9a39ae06cc27d1847
Component: engine
2014-04-26 03:27:56 +03:00
69a18c6508 Separating cgroup Memory and MemoryReservation.
This will allow for these to be set independently. Keep the current Docker behavior where Memory and MemoryReservation are set to the value of Memory.

Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
Upstream-commit: f188b9f623e23ee624aca8654bf00f49ee3bae29
Component: engine
2014-04-24 11:09:38 -07:00
a750afc31e Mount over dev and only copy allowed nodes in
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5ba1242bdc309352c2b0b9a1ef9e07fe835e4857
Component: engine
2014-04-24 10:35:20 -07:00
20ba5d97da No not mount sysfs by default for non privilged containers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 81e5026a6afb282589704fd5f6bcac9ed50108ea
Component: engine
2014-04-24 10:35:20 -07:00
9da373d6b1 Add restrictions to proc in libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 60a90970bc4add3547064004f08c19ab5027141b
Component: engine
2014-04-24 10:35:19 -07:00
1ea14534fa Merge branch 'master' into load-profile
Conflicts:
	daemon/execdriver/native/create.go
	daemon/execdriver/native/driver.go

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: 813cebc64fb4b628e2938405d86144060c330eb9
Component: engine
2014-04-21 10:32:13 -07:00
f7be50364d Rename runtime/* to daemon/*
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 359b7df5d2af5733b8a1ea6746d062053053b23e
Component: engine
2014-04-17 14:43:01 -07:00