Commit graph

201 commits

Author SHA1 Message Date
Jessica Frazelle
7dce902494 Get rid of panic in stats for lxc
Fix containers dir

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
2015-03-24 21:12:06 -07:00
Jessie Frazelle
22dba32b4d Merge pull request #10527 from mfojtik/lxc_11
Fix lxc-start in lxc>1.1.0 where containers start daemonized by default
2015-03-24 17:37:27 -07:00
Michael Crosby
246cab90f2 Mkdir for lxc root dir before setup of symlink
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-24 15:53:23 -07:00
Michael Crosby
f3fc857e01 Merge pull request #11716 from LK4D4/root_in_run
Use /var/run/docker as root for execdriver
2015-03-24 14:58:30 -07:00
Alexander Morozov
1e788ec985 Use /var/run/docker as root for execdriver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-24 10:47:30 -07:00
Dan Walsh
fe9fe1473c We want to allow the sharing of /dev from the host into the
container.

docker run -v /dev:/dev should stop mounting other default mounts in i
libcontainer otherwise directories and devices like /dev/ptx get mishandled.

We want to be able to run libvirtd for launching vms and it needs
access to the hosts /dev.  This is a key componant of OpenStack.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-03-20 08:56:21 -04:00
Jessie Frazelle
5a239c0022 Merge pull request #11507 from crosbymichael/container-state
Cleanup libcontainer container state
2015-03-19 16:02:24 -07:00
Michael Crosby
455a272aef Merge pull request #11428 from vishh/parent-cgroup
Adding '--cgroup-parent' option.
2015-03-19 14:41:57 -07:00
Michael Crosby
2b12b099b8 Mount libcontainer state dir in tmpfs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-19 14:27:17 -07:00
Michael Crosby
06c939e527 Ensure the container state is removed on daemon boot
This ensures that the libcontainer state is fully removed for a
container after it is terminated.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-19 14:21:19 -07:00
Mrunal Patel
60ef4ae6fc Update libcontainer to 4a72e540feb67091156b907c4700e580a99f5a9d
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-03-19 14:42:23 -04:00
Michal Fojtik
d62f25e422 Fix lxc-start in lxc>1.1.0 where containers start daemonized by default
Signed-off-by: Michal Fojtik <mfojtik@redhat.com>
2015-03-19 14:51:05 +01:00
Vishnu Kannan
0b1e2b5a55 Adding '--cgroup-parent' flag to docker run. This feature helps users implement more complex
resource isolation policies on top of what native docker provides.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
2015-03-19 02:34:15 +00:00
Michael Crosby
f4a458e67f Do not mask /proc/kcore in privileged
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-18 14:17:21 -07:00
Michael Crosby
f5a154f2d2 Don't hardcode default rlimit
The default for rlimit handling should be to inherit the rlimit of the
daemon unless explicitly set.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-03-17 16:04:15 -07:00
Jessie Frazelle
87a8658eb6 Merge pull request #11353 from mrunalp/override_default_mounts
Filter out default mounts that are being overriden by the user.
2015-03-16 16:40:32 -07:00
Mrunal Patel
7804cd36ee Filter out default mounts that are override by user.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
2015-03-16 18:39:50 -04:00
Michael Crosby
a2fcae41ef Merge pull request #11343 from hqhq/hq_fix_panic_error
fix panic error when docker stats a stopped container
2015-03-16 15:16:03 -07:00
Michael Crosby
0c2eb5ebfb Merge pull request #11295 from LK4D4/oom_after_dead
Check oom status after container stopped in lxc driver
2015-03-16 14:16:47 -07:00
Qiang Huang
8dc5791f73 fix panic error when docker stats a stopped container
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-16 19:55:34 +08:00
Arnaud Porterie
82f390e139 Merge pull request #11076 from hqhq/hq_use_warning_in_sysinfo
use type WARN for warning
2015-03-15 21:13:23 -07:00
Qiang Huang
837eec064d move resources from Config to HostConfig
Cgroup resources are host dependent, they should be in hostConfig.

For backward compatibility, we just copy it to hostConfig, and leave it in
Config for now, so there is no regressions, but the right way to use this
throught json is to put it in HostConfig, like:
  {
      "Hostname": "",
      ...
      "HostConfig": {
	  "CpuShares": 512,
          "Memory": 314572800,
          ...
      }
  }

As we will add CpusetMems, CpusetCpus is definitely a better name, but some
users are already using Cpuset in their http APIs, we also make it compatible.

The main idea is keep using Cpuset in Config Struct, and make it has the same
value as CpusetCpus, but not always, some scenarios:
 - Users use --cpuset in docker command, it can setup cpuset.cpus and can
   get Cpuset field from docker inspect or other http API which will get
   config info.
 - Users use --cpuset-cpus in docker command, ditto.
 - Users use Cpuset field in their http APIs, ditto.
 - Users use CpusetCpus field in their http APIs, they won't get Cpuset field
   in Config info, because by then, they should already know what happens
   to Cpuset.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-11 09:31:18 +08:00
Qiang Huang
bffe04b582 fix warning messages
Use log.Warnf instead of log.Infof, and remove redundant `WARNING` prefix.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-03-11 08:47:45 +08:00
Alexander Morozov
d59212e605 Check oom status after container stopped in lxc driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-10 13:45:13 -07:00
Alexander Morozov
821ec8334f Setup user groups in lxc driver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-10 09:43:11 -07:00
Alexander Morozov
c8c11bfc36 Use CgroupString instead of missing GetCgroupAllowString in lxc_template
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-10 08:50:03 -07:00
Jessie Frazelle
2fb89b2e2c Merge pull request #11208 from LK4D4/new_libcontainer_api
New libcontainer api
2015-03-10 07:50:19 -07:00
Arnaud Porterie
89bdaa35e0 Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
2015-03-06 18:21:51 -08:00
Alexander Morozov
68ba5f0b69 Execdriver implementation on new libcontainer API
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-03-06 14:46:58 -08:00
Brian Goff
3f39050637 Allow setting ulimits for containers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-02-25 19:37:43 -05:00
Abin Shahab
3bd3f7854a Restored removed docker init options
Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-02-24 16:59:04 +00:00
Abin Shahab
1a26ed09ee Implements stats for lxc driver
Implements stats and fixes stats test.

Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-02-23 10:16:52 +00:00
Alexander Morozov
e995670935 Fix possible panic on killing container
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-02-18 11:27:38 -08:00
Abin Shahab
9c744cb454 Fixes apparmor regression
Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-01-22 07:06:46 +00:00
Abin Shahab
3ca5af6b1a Adds ipc namespace capability to lxc, and fixes tests.
This fixes various tests by checking for non zero exit code, accounting for lxc-specific base-diffs, and by removing lxc specific environment vars.
It also adds the --share-ipc option to lxc-start for shared ipc namespaces.
Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-01-21 06:08:00 +00:00
Michael Crosby
2d4fc1de05 Refactor usage calc for CPU and system usage
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-20 20:21:46 -08:00
Michael Crosby
4f174aa792 Evict stopped containers
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-20 20:21:46 -08:00
Michael Crosby
2640a10bca Implement client side display for stats
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-20 20:21:46 -08:00
Michael Crosby
65f58e2a74 Implement container stats collection in daemon
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-20 20:21:46 -08:00
Abin Shahab
d821c63e0d use lxc.auto.mount to ensure proc and sys are readonly
Set lxc.auto.mount = proc:mixed in unprivilged mode. This ensures that lxc mounts sys and proc/sysrq-trigger as readonly.
Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-01-18 09:27:16 +00:00
Abin Shahab
bff3509e43 SEND CAPABILITY IDS TO LXC
Sending capability ids instead of capability names ot LXC for --cap-add and --cap-drop.
Also fixed tests.

Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2015-01-17 04:01:52 +00:00
Alexander Morozov
95c0f07966 Merge pull request #10093 from crosbymichael/readonly-containers
Add --read-only for read only container rootfs
2015-01-14 15:56:51 -08:00
Michael Crosby
409407091a Add --readonly for read only container rootfs
Add a --readonly flag to allow the container's root filesystem to be
mounted as readonly.  This can be used in combination with volumes to
force a container's process to only write to locations that will be
persisted.  This is useful in many cases where the admin controls where
they would like developers to write files and error on any other
locations.

Closes #7923
Closes #8752

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-14 15:41:31 -08:00
Alexander Morozov
5ce60217f1 Calming vet about type aliases from other package
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-01-14 14:01:36 -08:00
Dan Walsh
23feaaa240 Allow the container to share the PID namespace with the host
We want to be able to use container without the PID namespace.  We basically
want containers that can manage the host os, which I call Super Privileged
Containers.  We eventually would like to get to the point where the only
namespace we use is the MNT namespace to bring the Apps userspace with it.

By eliminating the PID namespace we can get better communication between the
host and the clients and potentially tools like strace and gdb become easier
to use.  We also see tools like libvirtd running within a container telling
systemd to place a VM in a particular cgroup, we need to have communications of the PID.

I don't see us needing to share PID namespaces between containers, since this
is really what docker exec does.

So currently I see us just needing docker run --pid=host

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2015-01-13 16:35:17 -08:00
Michael Crosby
582a79f00a Update lxc with libcontainer SetupUser change
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2015-01-12 10:43:33 -08:00
Malte Janduda
813ff7f19d Adding IPv6 network support to docker
Signed-off-by: Malte Janduda <mail@janduda.net>
2015-01-09 00:13:09 +01:00
Abin Shahab
f91650376a LXC TEMPLATE ALLOWS IPV4 OVERRIDE
This fixes the issue where an lxc.conf override of lxc.network.ipv4 was not being honored.

Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
2014-12-25 20:06:59 +00:00
Alexander Morozov
50905a6d6c 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>
2014-12-23 12:10:03 -08:00
Alexander Morozov
e7d086c2be Fix vet errors about unkeyed fields
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2014-12-12 10:44:59 -08:00