Commit Graph

133 Commits

Author SHA1 Message Date
5ee2e5422a Fix a typo in docker/daemon/execdriver/native/exec.go
Signed-off-by: Yan Feng <yanfeng2@huawei.com>
Upstream-commit: ab11d605556749e56e9dc5b4b071375765ad60bf
Component: engine
2015-04-09 11:46:09 -04:00
4f7e8c1d9e Removes unused function.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: 195bebd3a7b6ffab1cfbb15ad9835ad83bca9737
Component: engine
2015-04-07 18:15:28 -04:00
7919b8b131 Fix a minor typo
Signed-off-by: Guo Xiuyan <guoxiuyan@huawei.com>
Upstream-commit: ffcc4a1e52def3b1552ae3c7ba4ee1fb47f92cea
Component: engine
2015-04-04 15:36:35 +08:00
aeb6266db3 Return closed channel if oom notification fails
When working with Go channels you must not set it to nil or else the
channel will block forever.  It will not panic reading from a nil chan
but it blocks.  The correct way to do this is to create the channel then
close it as the correct results to the caller will be returned.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 7061a993c5b620d6e68450f1b90f3458bfa1add0
Component: engine
2015-04-01 15:30:48 -07:00
9ce95596ab Do not mask *exec.ExitError
Fix #11764

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: f468bbb7e8c89204bd5d8f346ecec4606b9f3b31
Component: engine
2015-03-30 15:31:49 -07:00
c6b7d50add Get child processes before main process die
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 5a1e5cf8c9bff51f6314754c039bf7511e2fb613
Component: engine
2015-03-30 13:28:34 -07:00
6af6b1f997 Use proper wait function for --pid=host
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 489ab77f4aea9bc3e7ada751cab5d827040b1e8b
Component: engine
2015-03-30 13:27:38 -07:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
d5ac91b394 Merge pull request #11716 from LK4D4/root_in_run
Use /var/run/docker as root for execdriver
Upstream-commit: f3fc857e018dc919fddfea645b8308379343cb4e
Component: engine
2015-03-24 14:58:30 -07:00
a6001c7df9 Use /var/run/docker as root for execdriver
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 1e788ec9855058913de6ac8a2be7acee0f001954
Component: engine
2015-03-24 10:47:30 -07:00
ca334b9a3a 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)
Upstream-commit: fe9fe1473cc54c4d2962391d6fa05ecc1c2c96f1
Component: engine
2015-03-20 08:56:21 -04:00
ec306144db Mount libcontainer state dir in tmpfs
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 2b12b099b8c60f02142ab8ece68987a8fba00292
Component: engine
2015-03-19 14:27:17 -07:00
cb0e64d97b 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>
Upstream-commit: 06c939e5279eb62b9088202a27d02d67c1cba6a5
Component: engine
2015-03-19 14:21:19 -07:00
67dd189d62 Update libcontainer to 4a72e540feb67091156b907c4700e580a99f5a9d
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: 60ef4ae6fcb015546a646eb3b613344a9c4fc27b
Component: engine
2015-03-19 14:42:23 -04:00
dc45397f85 Do not mask /proc/kcore in privileged
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: f4a458e67f9cedae9167cc70d15fd8bbe942f880
Component: engine
2015-03-18 14:17:21 -07:00
b6b5f87d20 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>
Upstream-commit: f5a154f2d2b2bea5054ae35314d15021a8bf8ae4
Component: engine
2015-03-17 16:04:15 -07:00
9596e6f457 Merge pull request #11353 from mrunalp/override_default_mounts
Filter out default mounts that are being overriden by the user.
Upstream-commit: 87a8658eb625d25d4d72bf65efc5629be4c99d40
Component: engine
2015-03-16 16:40:32 -07:00
9b00b0ac0c Filter out default mounts that are override by user.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Upstream-commit: 7804cd36eec45c184dcabdbcb52033c1c0179c03
Component: engine
2015-03-16 18:39:50 -04:00
bd0b1983fb Merge pull request #11343 from hqhq/hq_fix_panic_error
fix panic error when docker stats a stopped container
Upstream-commit: a2fcae41efdc52087d733d962b9ee3ef37a81450
Component: engine
2015-03-16 15:16:03 -07:00
45269e9133 fix panic error when docker stats a stopped container
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 8dc5791f7302aea0734a26dc1f54d96b04771b8f
Component: engine
2015-03-16 19:55:34 +08:00
ad6ee8ec46 fix warning messages
Use log.Warnf instead of log.Infof, and remove redundant `WARNING` prefix.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: bffe04b582d143f074297b260a359dfb54a7763b
Component: engine
2015-03-11 08:47:45 +08:00
3b04936e06 Execdriver implementation on new libcontainer API
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 68ba5f0b69c9f383269fb5bc2c78798b312e98cc
Component: engine
2015-03-06 14:46:58 -08:00
2e0ec2c817 Allow setting ulimits for containers
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 3f39050637d454e9ee8075153a917c8bfccb5bae
Component: engine
2015-02-25 19:37:43 -05:00
848426a114 Implements stats for lxc driver
Implements stats and fixes stats test.

Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Upstream-commit: 1a26ed09ee6199341297f5e5ef8c5ed30efb6596
Component: engine
2015-02-23 10:16:52 +00:00
79286179ed Fix possible panic on killing container
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: e995670935118ad7ff485aee7fd3d4767e4c3e29
Component: engine
2015-02-18 11:27:38 -08:00
debfc19162 Refactor usage calc for CPU and system usage
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 2d4fc1de0560c8052b4480035bb364fb28525b39
Component: engine
2015-01-20 20:21:46 -08:00
2dcbad59cf Evict stopped containers
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 4f174aa79276c12a1b2b98df2f02d6bee36b7a93
Component: engine
2015-01-20 20:21:46 -08:00
03d1b8dbe7 Implement client side display for stats
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 2640a10bca29c4a4199c906a26f658aac8a68dc2
Component: engine
2015-01-20 20:21:46 -08:00
947efff180 Implement container stats collection in daemon
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 65f58e2a742205c9e8470b360bd439642a5c8211
Component: engine
2015-01-20 20:21:46 -08:00
2a3eb3ae39 Merge pull request #10093 from crosbymichael/readonly-containers
Add --read-only for read only container rootfs
Upstream-commit: 95c0f07966035ce79c6b51a2eee8c60c59fb523c
Component: engine
2015-01-14 15:56:51 -08:00
2ef8faf6e3 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>
Upstream-commit: 409407091a7282d0c4086b71e86397e2d089ba13
Component: engine
2015-01-14 15:41:31 -08:00
2c43314302 Calming vet about type aliases from other package
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 5ce60217f1ba07015af72978e715a08259e2efc1
Component: engine
2015-01-14 14:01:36 -08:00
458ae31cfd 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)
Upstream-commit: 23feaaa240853c0e7f9817f8c2d272dd1c93ac3f
Component: engine
2015-01-13 16:35:17 -08:00
146962fdd3 Adding IPv6 network support to docker
Signed-off-by: Malte Janduda <mail@janduda.net>
Upstream-commit: 813ff7f19d6a097f39dae363d8dd81b70eee515a
Component: engine
2015-01-09 00:13:09 +01:00
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
7886e44221 Fix vet errors about unkeyed fields
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: e7d086c2be41dfedfa5f2fb0c437eb5bbf6f2f5d
Component: engine
2014-12-12 10:44:59 -08:00
8582931138 Merge pull request #9074 from rhatdan/shm
Allow IPC namespace to be shared between containers or with the host
Upstream-commit: 07996d82c76f0c73555d4de27371757e8879d378
Component: engine
2014-11-14 10:34:00 -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
b1aa2c30f8 Address comments.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 46f29449777b9fb67a02e13fe0f12fc10c99ab4b
Component: engine
2014-11-08 00:14:08 +00:00
77c86e509b This patch adds ability in docker to detect out of memory conditions in containers.
Since the containers can handle the out of memory kernel kills gracefully, docker
will only provide out of memory information as an additional metadata as part of
container status.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: f96e04ffc7973e290653044cc86dbc1efb18276d
Component: engine
2014-11-08 00:14:08 +00:00
cf55a62eb5 Update docker with syncpipe changes
We removed the syncpipe package and replaced it with specific calls to
create a new *os.File from a specified fd passed to the process.  This
reduced code and an extra object to manage the container's init
lifecycle.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: ed556fb38f4d1cba1460650f703cc8147a7b8f32
Component: engine
2014-11-06 01:14:13 +00:00
3dbfc4607d pkg/reexec: move reexec code to a new package
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: acd64278f13ef0ee565f4819951393b9c3fe89eb
Component: engine
2014-10-30 14:48:30 +02: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
788ec364da Persistent directory for container in execdriver
This is needed for persistent namespaces

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 623ebf203bc4f4e6ddefdd494f201a1401ab72a6
Component: engine
2014-09-22 22:48:26 +04:00
d25c9ab27a Merge pull request #8062 from vishh/run_in_phase2
Add support for 'docker exec' - phase 2
Upstream-commit: 00fd008170e463426001ec4c56fc4c39450fd8d0
Component: engine
2014-09-16 23:56:12 +04:00