Commit Graph

503 Commits

Author SHA1 Message Date
b701571f37 beam/data: Message.GetOne() returns the last value set at a key
This is a convenience for callers which are only interested in one value
per key. Similar to how HTTP headers allow multiple keys per value, but
are often used to store and retrieve only one value.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 2af030ab57d1d84ac9a1d22552dc9d83b16951c4
Component: engine
2014-05-09 17:01:27 -07:00
c3352a3b6c Fix stdin handling in engine.Sender and engine.Receiver
This introduces a superficial change to the Beam API:

* `beam.SendPipe` is renamed to the more accurate `beam.SendRPipe`
* `beam.SendWPipe` is introduced as a mirror to `SendRPipe`

There is no other change in the beam API.

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 0aeff69e5900a15e3872494ac0009600f6c1c372
Component: engine
2014-05-09 15:39:55 -07:00
0e12d2d077 Merge pull request #5673 from tianon/kcore-error
Update restrict.Restrict to both show the error message when failing to mount /dev/null over /proc/kcore, and to ignore "not exists" errors while doing so (for when CONFIG_PROC_KCORE=n in the kernel)
Upstream-commit: 7673e3c58938aa4179f3ec84ed4960b4b6267c14
Component: engine
2014-05-08 10:20:19 -07:00
891da1c12d Merge pull request #5535 from vmarmol/add-maintainers-cgroup
Adding Rohit Jnagal and Victor Marmol to pkg/cgroups maintainers.
Upstream-commit: 718154b3b6db33a77fb05829d29abcebb77beb86
Component: engine
2014-05-08 09:48:31 -07:00
71620ac1c0 Update restrict.Restrict to both show the error message when failing to mount /dev/null over /proc/kcore, and to ignore "not exists" errors while doing so (for when CONFIG_PROC_KCORE=n in the kernel)
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
Upstream-commit: d60301edb88a4e182a10cd2becb3795b2dd13fab
Component: engine
2014-05-08 01:03:45 -06:00
29bfaa0d20 use tabwriter to display usage in mflag
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 77098d5b5bf8840a1179380b34aedb26139b9d65
Component: engine
2014-05-06 21:31:21 +00:00
36de1a047f Merge pull request #5631 from vmarmol/cpuacct-usage
Export cpuacct CPU usage in total cores over the sampled period.
Upstream-commit: 5c12a27838b88580aaa6fd967a9f0b60d3e838af
Component: engine
2014-05-06 11:47:55 -07:00
7ab4226907 Export cpuacct CPU usage in total cores over the sampled period.
Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
Upstream-commit: 543e60eb60fed2734c10953216003325beddd536
Component: engine
2014-05-06 16:56:39 +00:00
8376ec5af9 Merge pull request #5630 from rjnagal/libcontainer-fixes
Check supplied hostname before using it.
Upstream-commit: 818648ff9f9e506e2d296fb73ef55dc8f87648fb
Component: engine
2014-05-06 09:49:52 -07:00
23cfbb7add Merge pull request #5629 from vmarmol/fix-systemd-softlimit
Remove support for MemoryReservation in systemd systems.
Upstream-commit: 7e3a1b652193abd8379905cb4dac2df53dc634fb
Component: engine
2014-05-06 09:48:33 -07:00
7754f52438 Remove support for MemoryReservation in systemd systems. This has been
deperecated since systemd 208.

Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
Upstream-commit: 69d43b2674aa8ed69c641556cae68d405505a45b
Component: engine
2014-05-06 15:53:38 +00:00
0dedb88d50 pkg: networkfs: etchosts: fixed tests
This patch fixes the fact that the tests for pkg/networkfs/etchosts
couldn't build due to syntax errors.

Docker-DCO-1.1-Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
Upstream-commit: 14f65ab83b4f72ea56b3e98023e941474d4e9dd8
Component: engine
2014-05-07 00:42:22 +10:00
1d128ba235 add linked containers to hosts file
Docker-DCO-1.1-Signed-off-by: Bryan Murphy <bmurphy1976@gmail.com> (github: bmurphy1976)

Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Tested-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 53f38a14cd6b61a6b5df68cc3694dcba2b0c1eb7
Component: engine
2014-05-05 19:40:27 -07:00
dfb1a0bff0 Merge pull request #5354 from alexlarsson/cgroups-systemd-fixes
cgroups: Update systemd to match fs backend
Upstream-commit: 0b15944cb047e6467f399ebf5c3f93262fe4c06f
Component: engine
2014-05-05 16:00:56 -07:00
ac35d8965e add resolvconf
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 3744452ecf46351758478e99795e20b186a1bee4
Component: engine
2014-05-05 22:55:32 +00:00
60d5f26ff6 add etchosts
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: a1a029f6d7f980960135c1346a1e9f7830692fac
Component: engine
2014-05-05 22:43:38 +00:00
1952f255b6 Merge pull request #5602 from crosbymichael/libcontainer-enable
Improve libcontainer namespace and cap format
Upstream-commit: 2165a4993b849c3ac4a6f3ccb7af91b0d1f79b50
Component: engine
2014-05-05 13:50:08 -07:00
db1f1daa38 Merge pull request #5400 from bmatsuo/5398-fix-pkg/graphdb-osx
Upstream-commit: 99be2353329c7106958a852eb08776fac5c0c2b0
Component: engine
2014-05-05 13:41:43 -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
d6e1c1cb2b Check supplied hostname before using it.
Docker-DCO-1.1-Signed-off-by: Rohit Jnagal <jnagal@google.com> (github: rjnagal)
Upstream-commit: 412324cfbe9b5e256d9af31b21e6ae142d39612c
Component: engine
2014-05-05 18:12:25 +00:00
074dcc8171 cgroups: Update systemd to match fs backend
This updates systemd.Apply to match the fs backend by:
* Always join blockio controller (for stats)
* Support CpusetCpus
* Support MemorySwap

Also, it removes the generic UnitProperties in favour of a single
option to set the slice.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 5b094530c09bca403819c06635c2f7fbaf98b937
Component: engine
2014-05-05 20:06:44 +02:00
f69322b472 Merge pull request #5556 from crosbymichael/no-restrict-lxc
Don't restrict lxc because of apparmor
Upstream-commit: 3a1f0dedc71712403c591dd9e552f7a906c2e4ea
Component: engine
2014-05-02 17:20:27 -07:00
ac76593583 Month devpts before mounting subdirs
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: a7ccbfd5f143af8a7accc69803b1588e568328ac
Component: engine
2014-05-02 13:55:45 -07:00
1ed0224965 Don't restrict lxc because of apparmor
We don't have the flexibility to do extra things with lxc because it is
a black box and most fo the magic happens before we get a chance to
interact with it in dockerinit.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 59fe77bfa638001cbe9af386f350d6e0dbb23398
Component: engine
2014-05-02 11:14:24 -07:00
4d667fa77e Merge pull request #5529 from crosbymichael/restrict-proc
Mount /proc and /sys read-only, except in privileged containers
Upstream-commit: 1c5a3123cc6ac396656b1027504748bd8dcd65e9
Component: engine
2014-05-02 10:52:53 -07:00
6e316a7be9 Apply apparmor before restrictions
There is not need for the remount hack, we use aa_change_onexec so the
apparmor profile is not applied until we exec the users app.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 76fa7d588adfe644824d9a00dafce2d2991a7013
Component: engine
2014-05-01 19:09:12 -07:00
634dd08b53 Adding Rohit Jnagal and Victor Marmol to pkg/libcontainer maintainers.
Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
Upstream-commit: 71e3757174c3c1617d636ddd7462c39617ba5a77
Component: engine
2014-05-01 15:51:38 -07:00
d53ebc7c71 Adding Rohit Jnagal and Victor Marmol to pkg/cgroups maintainers.
Docker-DCO-1.1-Signed-off-by: Victor Marmol <vmarmol@google.com> (github: vmarmol)
Upstream-commit: 91b5fe85029cfab2b7f8c55859e0fae999e9f968
Component: engine
2014-05-01 15:48:16 -07:00
4decb81304 Fix /proc/kcore mount of /dev/null
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 24e0df8136c238cb3e231b939a82058950e6eb02
Component: engine
2014-05-01 15:26:58 -07:00
6012a16a9d Mount attr and task as rw for selinux support
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 3f74bdd93f08b3001f11a137210ee67a6d23c084
Component: engine
2014-05-01 15:26:58 -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
2184511acc Update to enable cross compile
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 83982e8b1d0cd825e1762b5540db8ae77c34f065
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
675ce830a9 skip apparmor with dind
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: de191e86321f7d3136ff42ff75826b8107399497
Component: engine
2014-05-01 22:22:08 +00:00
d33d261bde drop CAP_SYSLOG capability
Kernel capabilities for privileged syslog operations are currently splitted into
CAP_SYS_ADMIN and CAP_SYSLOG since the following commit:
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=ce6ada35bdf710d16582cc4869c26722547e6f11

This patch drops CAP_SYSLOG to prevent containers from messing with
host's syslog (e.g. `dmesg -c` clears up host's printk ring buffer).

Closes #5491

Docker-DCO-1.1-Signed-off-by: Eiichi Tsukata <devel@etsukata.com> (github: Etsukata)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: cac0cea03f85191b3d92cdaeae827fdd93fb1b29
Component: engine
2014-05-01 11:43:55 -07:00
ec54d1dc2d Merge pull request #5515 from crosbymichael/refactor-libcontainer2
Remove CommandFactory and NsInit interface
Upstream-commit: fe4a25546a434eb0299bdc7f61a3cfcc3752fb33
Component: engine
2014-05-01 11:41:54 -07:00
a4471696ab beam: Add simple framing system for UnixConn
This is needed for Send/Recieve to correctly handle borders between
the messages.

The framing uses a single 32bit uint32 length for each frame, of which
the high bit is used to indicate whether the message contains a file
descriptor or not. This is enough to separate out each message sent
and to decide to which message each file descriptors belongs, even
though multiple Sends may be coalesced into a single read, and/or one
Send can be split into multiple writes.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 24f9187a0467ca66c30e26c3d9e3ee58daeb720f
Component: engine
2014-05-01 11:06:01 -07:00
c94cce9900 Remove container.json from readme
No need to duplicate this information when we already have a
container.json file in the root of libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d0bee7939482b982462c5848f24b2e5e9ad897ea
Component: engine
2014-04-30 18:52:15 -07:00
b43bfc67a6 Make native driver use Exec func with different CreateCommand
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: da0d6dbd7b5b429b79ae4ea22957e8a14b4ca1ec
Component: engine
2014-04-30 18:49:24 -07:00
c0992a66d2 Fix execin with environment and Enabled support
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: aa9705f832d847d6e6ce76e19f3c952c194c167e
Component: engine
2014-04-30 18:24:47 -07:00
4b320ae74d Integrate new structure into docker's native driver
This duplicates some of the Exec code but I think it it worth it because
the native driver is more straight forward and does not have the
complexity have handling the type issues for now.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 60e4276f5af360dd3292e22993c0c132a86edc2e
Component: engine
2014-04-30 18:20:01 -07:00
8cf0bc757c Remove command factory and NsInit interface from libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 176c49d7a9e5a81b6c80e18dea84864148360597
Component: engine
2014-04-30 17:55:15 -07:00
3b07a6b498 Export more functions from libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: b6b0dfdba7bda13d630217830423580c3152899d
Component: engine
2014-04-30 17:18:07 -07:00
04ee258620 Split term files to make it easier to manage
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: aecb9c39ab0eb5f09ebab40001fe0ff639ef617b
Component: engine
2014-04-30 17:04:24 -07:00
2b44341c25 Export syncpipe fields
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a3e96abb5aacaa763f3f9205316dd0aef1977f16
Component: engine
2014-04-30 17:02:45 -07:00
3c350a7bfd Merge pull request #5511 from crosbymichael/refactor-libcontainer
Refactor: remove statewriter type and all callback for process start
Upstream-commit: 26ac05c8bce47fd37c35e43b98cdbcfb65a5c9bb
Component: engine
2014-04-30 16:50:57 -07:00
47e64912c0 Merge pull request #5512 from crosbymichael/set-freezer
Add ability to set cgroups freezer
Upstream-commit: be013c7820747af5e3696ad306b817aa437dd3c4
Component: engine
2014-04-30 16:50:01 -07:00
4188748bd6 Add ability to set cgroups freezer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5f6fda8cfd05dec002894d3e2214a04a58b62bed
Component: engine
2014-04-30 16:07:12 -07:00
e0c447076a Remove statewriter interface, export more libcontainer funcs
This temp. expands the Exec method's signature but adds a more robust
way to know when the container's process is actually released and begins
to run.  The network interfaces are not guaranteed to be up yet but this
provides a more accurate view with a single callback at this time.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: f1104014372e71e1f8ae7a63d17e18de5e2fa93a
Component: engine
2014-04-30 15:52:40 -07:00
c5e3da18ab Export SetupUser
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: cd8cec854be33a74179618864cd528acf5129cd9
Component: engine
2014-04-30 15:27:59 -07:00