Commit Graph

297 Commits

Author SHA1 Message Date
7b98273c2e Merge pull request #14887 from Microsoft/10662-stupidtypo
Windows: Stupid copy/paste error
Upstream-commit: 9dcd0cc1ee442ca262491b7738890793be641abc
Component: engine
2015-07-23 14:49:17 -04:00
f26842120f Merge pull request #14855 from ewindisch/apparmor-unconfined
Introduce a dedicated unconfined AA policy
Upstream-commit: ac9fc03c74e65a6a18bc0854d4a2841637fe1acf
Component: engine
2015-07-23 10:21:51 -07:00
c8167142d1 Windows: Stupid copy/paste error
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: cef5cb2dcbe1089f5fde6478a9c0f2ed93ce3c80
Component: engine
2015-07-22 19:30:47 -07:00
9f8e7b5fed Introduce a dedicated unconfined AA policy
By using the 'unconfined' policy for privileged
containers, we have inherited the host's apparmor
policies, which really make no sense in the
context of the container's filesystem.

For instance, policies written against
the paths of binaries such as '/usr/sbin/tcpdump'
can be easily circumvented by moving the binary
within the container filesystem.

Fixes GH#5490

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 87376c3add7dcd48830060652554e7ae43d11881
Component: engine
2015-07-22 11:28:32 -04:00
e5400db724 Remove unused parameter in NewTtyConsole
It's introduced in
68ba5f0b69c9f38 (Execdriver implementation on new libcontainer API)

But I don't see reson why we need it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: af3059855c0b59c08b115a70d3f61b0fab3270de
Component: engine
2015-07-22 10:32:31 +08:00
58f999ca51 Windows: Remove erroneous comment
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: bd30d27636718b3ea576caa52807507d57283580
Component: engine
2015-07-21 14:25:08 -07:00
b6a0d280f9 Remove unused TtyTerminal interface
It was used only by integration tests, which now gone.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6ae377ffa0c106749db1bcd6cf158f8b0056dea8
Component: engine
2015-07-21 09:56:28 -07:00
74cf202b4f Move AppArmor policy to contrib & deb packaging
The automatic installation of AppArmor policies prevents the
management of custom, site-specific apparmor policies for the
default container profile. Furthermore, this change will allow
a future policy for the engine itself to be written without demanding
the engine be able to arbitrarily create and manage AppArmor policies.

- Add deb package suggests for apparmor.
- Ubuntu postinst use aa-status & fix policy path
- Add the policies to the debian packages.
- Add apparmor tests for writing proc files
Additional restrictions against modifying files in proc
are enforced by AppArmor. Ensure that AppArmor is preventing
access to these files, not simply Docker's configuration of proc.
- Remove /proc/k?mem from AA policy
The path to mem and kmem are in /dev, not /proc
and cannot be restricted successfully through AppArmor.
The device cgroup will need to be sufficient here.
- Load contrib/apparmor during integration tests
Note that this is somewhat dirty because we
cannot restore the host to its original configuration.
However, it should be noted that prior to this patch
series, the Docker daemon itself was loading apparmor
policy from within the tests, so this is no dirtier or
uglier than the status-quo.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 80d99236c1ef9d389dbaca73c1a949da16b56b42
Component: engine
2015-07-21 11:05:53 -04:00
d9e652a366 Update libcontainer
Replaced github.com/docker/libcontainer with
github.com/opencontainers/runc/libcontaier.
Also I moved AppArmor profile generation to docker.

Main idea of this update is to fix mounting cgroups inside containers.
After updating docker on CI we can even remove dind.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c86189d554ba14aa04b6314970d3699e5ddbf4de
Component: engine
2015-07-16 16:02:26 -07:00
d192eb2289 Merge pull request #14620 from hqhq/hq_cgroup_ro_optional
Remove cgroup read-only flag when privileged
Upstream-commit: 8801906cedb73f171a8556294e78d649fee3db32
Component: engine
2015-07-16 16:00:02 -07:00
c4cef0431e Merge pull request #14604 from Microsoft/10662-addbridge
Windows: Plumb through -b on daemon
Upstream-commit: 97515a35ca4c91f1a1444f73f5fe9385a94f1dd1
Component: engine
2015-07-16 08:44:40 -07:00
ca53cad1a3 Remove cgroup read-only flag when privileged
Fixes: #14543

It needs libcontainer fix from:
https://github.com/opencontainers/runc/pull/91

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: a7f5e1c4c3559127758131123242bb54f26da8ce
Component: engine
2015-07-14 15:00:41 +08:00
43c3fe4dbf Windows: Plumb through -b on daemon
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: e0ec0cc115a7b271defc7ab5680eb6836ef71c7a
Component: engine
2015-07-13 12:41:48 -07:00
b0da7fa04d Adds support for specifying additional groups.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: e0d96fb3ef562103690529c34140d04604599497
Component: engine
2015-07-13 14:47:28 -04:00
11e2c4a554 Add the memory swappiness tuning option to docker.
Memory swappiness option takes 0-100, and helps to tune swappiness
behavior per container.
For example, When a lower value of swappiness is chosen
the container will see minimum major faults. When no value is
specified for memory-swappiness in docker UI, it is inherited from
parent cgroup. (generally 60 unless it is changed).

Signed-off-by: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
Upstream-commit: 921da495d24695dda66d3f58e78887dd0bc2402e
Component: engine
2015-07-12 13:16:33 +05:30
9f9bda0c57 Merge pull request #13669 from ewindisch/readonly-proc
Make /proc, /sys, & /dev readonly for readonly containers
Upstream-commit: 703248da20566f707b8290662805a9264629e2e0
Component: engine
2015-07-10 15:32:13 -07:00
576b45a55d Merge pull request #13554 from Microsoft/10662-winexec
Windows: The real Windows exec driver is here.
Upstream-commit: b7e8169274ba4b897601e1025b91ebd361902213
Component: engine
2015-07-10 17:13:10 -04:00
c3450bd95b Windows: Exec driver
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 9ae9d4c87af8b04eb80006aca9f760ffdb1052bb
Component: engine
2015-07-10 13:36:56 -07:00
c770b13f1f Add cgroup bind mount by default
Libcontainer already supported mount container's own cgroup into
container, with this patch, we can see container's own cgroup info
in container.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: f18fb5b3efd59d54c00d4e1b1d4b88c4b21e96be
Component: engine
2015-07-10 13:12:09 +08:00
793088ed0a Make /proc, /sys, /dev readonly for readonly containers
If a container is read-only, also set /proc, /sys,
& /dev to read-only. This should apply to both privileged and
unprivileged containers.

Note that when /dev is read-only, device files may still be
written to. This change will simply prevent the device paths
from being modified, or performing mknod of new devices within
the /dev path.

Tests are included for all cases. Also adds a test to ensure
that /dev/pts is always mounted read/write, even in the case of a
read-write rootfs. The kernel restricts writes here naturally and
bad things will happen if we mount it ro.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 5400d8873f730e6099d29af49fe45931665c3b49
Component: engine
2015-07-02 19:08:00 +00:00
842ad32482 Replace latest log by logrus
Related to #11618 and #11614

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 10e114fb956db1b1a8bc9308cc6d14cbf30a5bab
Component: engine
2015-07-02 16:11:52 +02:00
b565b94e85 daemon: lower allocations
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
Upstream-commit: c1477db04fc32621652cf6a8fd2976b6bbf2066e
Component: engine
2015-06-30 01:45:31 +03:00
f74cf65168 Merge pull request #14030 from estesp/init-memory-swappiness
Initialize swappiness in libcontainer cgroups template
Upstream-commit: c2815496101e7523c8bc2e459026f8c5e84cdb08
Component: engine
2015-06-25 11:36:54 -07:00
824de2eaf8 Initialize swappiness in libcontainer cgroups template
By default, the cgroup setting in libcontainer's configs.Cgroup for
memory swappiness will default to 0, which is a valid choice for memory
swappiness, but that means by default every container's memory
swappiness will be set to zero instead of the default 60, which is
probably not what users are expecting.

When the swappiness UI PR comes into Docker, there will be docker run
controls to set this per container, but for now we want to make sure
*not* to change the default, as well as work around an older kernel
issue that refuses to allow it to be set when cgroup hiearchies are in
use.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 9e9d2276777ba6f48390a33d67ed544b5c183968
Component: engine
2015-06-18 19:27:04 -04:00
7b04b15fbc Fix typo in lxc_template.go
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: cb979edec0c8a8ba5a874abcbf74eae3a48fe52c
Component: engine
2015-06-16 15:19:43 -07:00
1d551c443c Make LXC exec driver compatible with recent LXC where lxc.autodev is enabled by default
Update LXC to 1.1.2

Signed-off-by: Alex Samorukov <samm@os2.kiev.ua>
Upstream-commit: 6089e679a2fb2494fd3e599a9eab9327e6a509fc
Component: engine
2015-06-16 15:19:00 -07:00
61e1950d67 Correct getEnv split.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 85f895ce681ebbc3a1990ef73875cf94b5c77d17
Component: engine
2015-06-11 14:40:46 -07:00
ebc23891b1 Revert shared container rootfs
This is breaking various setups where the host's rootfs is mount shared
correctly and breaks live migration with bind mounts.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: c9d71317be5fd13ba544a2699442a40ccf2cc3cc
Component: engine
2015-06-10 11:29:27 -07:00
9eb2d545d0 fix lxc build
Signed-off-by: Jessica Frazelle <princess@docker.com>
Upstream-commit: 0adfb908a682e679b54f511fe89e668d6e676dda
Component: engine
2015-06-05 09:50:30 -07:00
8354ab7272 Remove useless debug message
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: f1b59d64d21d5a0f54536b26161a31441697ca61
Component: engine
2015-06-01 11:15:15 -07:00
d9b5b5714d Merge pull request #13491 from jfrazelle/revert-exec-privileged
Revert "Add docker exec run a command in privileged mode"
Upstream-commit: b50e7809254c1d3cc9bd2b94be0c87b68576ed2a
Component: engine
2015-05-26 16:41:50 -07:00
dc2caf8054 Merge pull request #13444 from runcom/fix-race-stats
Fix race in stats cli and native driver
Upstream-commit: 0d445685b8d628a938790e50517f3fb949b300e0
Component: engine
2015-05-26 15:34:50 -07:00
d89704cf56 Revert "Add docker exec run a command in privileged mode"
This reverts commit 72a500e9e5929b038816d8bd18d462a19e571c99.

Signed-off-by: Jessica Frazelle <princess@docker.com>

Conflicts:
	daemon/execdriver/native/exec.go
	integration-cli/docker_cli_exec_test.go
	runconfig/exec.go
Upstream-commit: 40b71adee390e9c06471b89ed845132b4ec80177
Component: engine
2015-05-26 14:12:16 -07:00
e0098fdbb0 Add lock before accessing native driver active containers
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 9e425d56d0ec7d3343dd309500a7fe6e36648f2b
Component: engine
2015-05-26 13:55:02 +02:00
722bcfc109 Fix race in stats cli and native driver
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 77280a87b70d3b2b629cd30ea93464287f346fa1
Component: engine
2015-05-26 13:55:02 +02:00
7623ba5e39 Fix network with -b none
* Don't AllocateNetwork when network is disabled
* Don't createNetwork in execdriver when network is disabled

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 3cb14df68c1a59981907fec3bccab80a1d0dda59
Component: engine
2015-05-24 08:26:59 -07:00
f301559fd5 Windows: Empty Windows Exec Driver
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 8db09ff6290fb2d4aea121c2850940b9bc480ce9
Component: engine
2015-05-20 08:54:04 -07:00
6f37ffc9e3 Removed dead code from docker after libnetwork integration
As part of this some generic packages like iptables, etchosts and resolvconf
have also been moved to libnetwork. Even though they can still be
consumed in a generic fashion they will reside and be maintained
from within the libnetwork project.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: f12f51b8b934c21621c17590f1d526377a297a0d
Component: engine
2015-05-19 22:40:55 +00:00
13426de5e6 Docker integration with libnetwork
- Updated Dockerfile to satisfy libnetwork GOPATH requirements.
    - Reworked daemon to allocate network resources using libnetwork.
    - Reworked remove link code to also update network resources in libnetwork.
    - Adjusted the exec driver command population to reflect libnetwork design.
    - Adjusted the exec driver create command steps.
    - Updated a few test cases to reflect the change in design.
    - Removed the dns setup code from docker as resolv.conf is entirely managed
      in libnetwork.
    - Integrated with lxc exec driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
Upstream-commit: d18919e304c240df84502cdcc5ed655d92d12d4f
Component: engine
2015-05-19 22:40:19 +00:00
4e71899e7f Windows: NewDriver() re-baseline parms
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 50b4079b5fdb9d966f49946c8db36c81648c1dee
Component: engine
2015-05-16 11:38:19 -07:00
dc9bbf77b5 Add --uts=host to allow sharing the UTS namespace
Signed-off-by: Darren Shepherd <darren@rancher.com>
Upstream-commit: f2e5207fc989288ad136d48222df8e7754eb0e9b
Component: engine
2015-05-13 17:56:32 -07:00
c578ab5fb7 Fix race between execdriver.Kill and execdriver.Run
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ca7219f5daa194ae714c3a3396703e08d8a137c8
Component: engine
2015-05-11 13:23:50 -07:00
203bb4326e Merge pull request #13091 from LK4D4/generate_caps
Generate caps
Upstream-commit: 92344602eadd6500f9936593772e46cf7db2b518
Component: engine
2015-05-11 10:42:59 -07:00
560ba9b809 add cpu.cfs_period_us support
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Upstream-commit: dccb8b5c339e218222bae4ce74bbeccb9e020c82
Component: engine
2015-05-09 10:02:46 +08:00
11ef87f883 Generate capabilityList automatically
Generation based on CAP_LAST_CAP, I hardcoded
capability.CAP_BLOCK_SUSPEND as last for systems which has no
/proc/sys/kernel/cap_last_cap

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a559c1145af3162cd683866fd6f998ff5f57058f
Component: engine
2015-05-08 09:40:05 -07:00
5c2686119c Merge pull request #11802 from hqhq/hq_add_blkio_weight
add blkio.weight support
Upstream-commit: de32f5c431bbdb56d6a446af0e5660fae9539bd8
Component: engine
2015-05-07 17:10:39 -07:00
13d096f3f5 Merge pull request #12830 from Microsoft/10662-refactorforwindowsexecdriver
Windows: Fork execdrivers.go for Windows execdriver
Upstream-commit: 67c10e762e1227c845e098af83afe5a8faaaf8c3
Component: engine
2015-05-07 16:57:59 -07:00
1d2b89b8ee Merge pull request #13062 from Microsoft/10662-nativedriver
Fix os.MkdirAll in native driver
Upstream-commit: b4dc101d746e657ab84547ae28d41d86fb6e4d34
Component: engine
2015-05-07 16:34:31 -07:00
ac6f208e83 Allow libcontainer to eval symlink destination
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>

Add tests for mounting into /proc and /sys

These two locations should be prohibited from mounting volumes into
those destinations.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: f25bbedc85e8a99c1389dbe8f48436907ce24526
Component: engine
2015-05-07 14:43:39 -07:00
c87ab46f22 Mask reads from timer_stats and latency_stats
These files in /proc should not be able to be read as well
as written to.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: a7a51306b1459a67da3a9cbbe8c9f80d3950c084
Component: engine
2015-05-07 14:42:23 -07:00