Commit Graph

153 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
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
84a6c7d576 LXC CAP ADD CAP DROP IN TEMPLATE
Added cap-drop and cap-add in lxc template
Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Upstream-commit: fdf745768350d2068aecd34734b38a2c27810132
Component: engine
2014-12-05 23:08:22 +00:00
ef9c1a57f6 Merge pull request #9039 from ashahab-altiscale/8617-lxc-volume
Have lxc create mount points if they don't exist
Upstream-commit: 1bac8f5322b1ec300326a7eaac18f712c385b5b2
Component: engine
2014-11-18 17:24:16 -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
4567691298 Merge pull request #9107 from ashahab-altiscale/9062-linked-container
Share network namespace of containers with lxc
Upstream-commit: 5c863f983df6ebc913890bd6095cc47d8a3a624b
Component: engine
2014-11-13 18:25:38 -08:00
a083823cc6 Merge pull request #8479 from vishh/OOM
Provide Out Of Memory information in container status
Upstream-commit: 08f5edce3092e55f90116fac1b6f634965008f2b
Component: engine
2014-11-12 14:15:29 -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
a69b5003b0 LINKED CONTAINER ID PASSED TO LXC
This passed the --net=container:CONTINER_ID to lxc-start as --share-net
Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Upstream-commit: adb07b53e083784e4f09935b8e3bdcf123db284e
Component: engine
2014-11-11 09:10:15 +00:00
e5f96cb7c0 execdriver/lxc: add comment to MAINTAINERS
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 6f8e42ac748e0c7597aeedf31adf81451adcda94
Component: engine
2014-11-08 16:27:25 +02: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
a3f4dc29b7 LXC TEMPLATE WILL CREATE MOUNT
Lxc driver was throwing errors for mounts where the mount point does not exist in the container.
This adds a create=dir/file mount option to the lxc template, to alleviate this issue.

Docker-DCO-1.1-Signed-off-by: Abin Shahab <ashahab@altiscale.com> (github: ashahab-altiscale)
Upstream-commit: b36bf9817482e97448f11a2f3eaf15b3a795d2f7
Component: engine
2014-11-06 02:14:03 +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
4454d2b409 Fix docker exec command help messages
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: d8b17d785a03246cb3a081223a0242469af7d410
Component: engine
2014-10-31 09:36:07 +08: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
bad39206ea Mass gofmt
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: ee7dd44c017458c8fe0be8e09569b1238366dca3
Component: engine
2014-10-24 15:11:48 -07:00
2d56e3cbc6 Use logrus everywhere for logging
Fixed #8761

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 7c62cee51edc91634046b4faa6c6f1841cd53ec1
Component: engine
2014-10-24 15:03:06 -07:00
5f681d731d Fix lxc driver build issue on Mac OS X
Docker-DCO-1.1-Signed-off-by: Albert Zhang <zhgwenming@gmail.com> (github: zhgwenming)
Upstream-commit: 210db1234dfb8d279bc1e5e2c8438dc8db2ee27d
Component: engine
2014-10-17 09:41:23 +08: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
fe37a1db8f Add --security-opts options to allow user to customize security configuration
security-opts will allow you to customise the security subsystem.

For example the labeling system like SELinux will run on a container.

    --security-opt="label:user:USER"   : Set the label user for the container
    --security-opt="label:role:ROLE"   : Set the label role for the container
    --security-opt="label:type:TYPE"   : Set the label type for the container
    --security-opt="label:level:LEVEL" : Set the label level for the container
    --security-opt="label:disabled"    : Turn off label confinement for the container

Since we are passing a list of string options instead of a space separated
string of options, I will change function calls to use InitLabels instead of
GenLabels.  Genlabels interface is Depracated.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 87e732a0f3503517d7a66804bb9a7f74977347e5
Component: engine
2014-09-30 00:06:22 +00: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
5a623782b5 Merge pull request #8191 from vieux/improve_error_exec_lxc
Improve error for docker exec & LXC
Upstream-commit: 0913009ebee670d5eb0f585cd8dffcb59f873bce
Component: engine
2014-09-25 15:58:21 -07:00
be3cb2a0ac Improve error for docker exec & LXC
Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: ab30e19b96ce498c8a7de748e197f12b5550a7b2
Component: engine
2014-09-23 21:47:33 +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
40a1e3c634 Address review comments.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 669561c2aa8966f9327eca4304a06168bcf5bc49
Component: engine
2014-09-15 17:00:00 +00:00
b0ee16aad4 Import nsenter in docker.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: e1cf95b593a57e0c8f15d50bb3e5e8ccfb55defa
Component: engine
2014-09-15 16:59:05 +00:00
a11625614e Adding support for docker exec in daemon.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 5130fe5d38837302e72bdc5e4bd1f5fa1df72c7f
Component: engine
2014-09-15 16:57:52 +00:00
f867da582c Adding Exec method to native execdriver.
Modified Attach() method to support docker exec.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: f3c767d798f945192d32441cf624bdd54e746b74
Component: engine
2014-09-15 16:57:52 +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
cf5c443ddd fix console attribute in lxc template
commit 4aa5da278f49c889d43191f82ff42d3a95266d62 moves `Console` from Command to
ProcessConfig, but missed the change in lxc_template. Therefore creating a
container with tty using lxc driver with fail with error

template: lxc:60:20: executing "lxc" at <.Console>: Console is not a field of
struct type struct { *execdriver.Command; AppArmor bool; ProcessLabel string; MountLabel string }

This changes lxc_console template to refers to `.ProcessConfig.Console`

Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com> (github: dqminh)
Upstream-commit: 4b3b54ca388cd49cd790def66fbce9af2be2f20f
Component: engine
2014-09-09 13:51:13 -04: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
559392405c Rename 'StdConfig' to 'StreamConfig'.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: 3a7e07355a1ad67f71ee4255e06526186fd48f7a
Component: engine
2014-09-01 14:31:01 -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
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
00b87e1af9 Fix go vet warnings
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 391c35c82252633eb415fdade08103a8a0818fde
Component: engine
2014-08-13 11:37:30 +04:00
01c8dcaf20 fix goroutines leak and exit code
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: b06311a72e7979653f09ba8175e10733e7116985
Component: engine
2014-08-13 00:03:56 +00:00
2fbe59b1d9 Use argv0 as reexec implementation for dockerinit
This changes the way the exec drivers work by not specifing a -driver
flag on reexec.  For each of the exec  drivers they register their own
functions that will be matched aginst the argv 0 on exec and called if
they match.

This also allows any functionality to be added to docker so that the
binary can be reexec'd and any type of function can be called.  I moved
the flag parsing on docker exec to the specific initializers so that the
implementations do not bleed into one another.  This also allows for
more flexability within reexec initializers to specify their own flags
and options.

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: 73210671764fc3de133a627205582e069e1ff43d
Component: engine
2014-08-11 11:47:21 -07:00
10183d52c2 Catch error on console creation
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 93f6cf035156d3b17cbf61f1a61926c068bd8e92
Component: engine
2014-08-09 22:10:44 +04:00
416ed08d2b Replace "amd64" build tags with "cgo" as appropriate, and remove where unnecessary
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 89ec17d11319ae39bff19985ac59fc878fe1fe1e
Component: engine
2014-08-06 17:20:21 -06:00
5c55cb7669 Purge the bits of pkg/system that moved to libcontainer/system
Signed-off-by: Andrew Page <admwiggin@gmail.com>
Upstream-commit: 60341f80d7b7918d1c1eff7c38cbc55c9bdec4d9
Component: engine
2014-08-02 01:35:04 -06:00
bf7a3474f4 Make lxc driver rbind all user specified mounts.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
Upstream-commit: d82bb603afab96a83ff58090ff807af5d55adc48
Component: engine
2014-07-30 02:23:24 +00:00
c827ecda15 Merge pull request #7062 from crosbymichael/fix-lxc-caps
Fix cap drop issues with lxc
Upstream-commit: ac3eecf3db5f81a553b71267f2e18ca7b7d95fea
Component: engine
2014-07-28 16:19:08 -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