Commit graph

1979 commits

Author SHA1 Message Date
Michael Crosby
42be9fb9d2 Merge branch 'master' into pluginflag
Conflicts:
	pkg/cgroups/cgroups.go
	pkg/libcontainer/nsinit/exec.go
	pkg/libcontainer/nsinit/init.go
	pkg/libcontainer/nsinit/mount.go
	runconfig/hostconfig.go
	runconfig/parse.go
	runtime/execdriver/driver.go
	runtime/execdriver/lxc/lxc_template.go
	runtime/execdriver/lxc/lxc_template_unit_test.go
	runtime/execdriver/native/default_template.go
	runtime/execdriver/native/driver.go

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-27 08:00:18 +00:00
Dan Walsh
2b01982d1f This patch adds SELinux labeling support.
docker will run the process(es) within the container with an SELinux label and will label
all of  the content within the container with mount label.  Any temporary file systems
created within the container need to be mounted with the same mount label.

The user can override the process label by specifying

-Z With a string of space separated options.

-Z "user=unconfined_u role=unconfined_r type=unconfined_t level=s0"

Would cause the process label to run with unconfined_u:unconfined_r:unconfined_t:s0"

By default the processes will run execute within the container as svirt_lxc_net_t.
All of the content in the container as svirt_sandbox_file_t.

The process mcs level is based of the PID of the docker process that is creating the container.

If you run the container in --priv mode, the labeling will be disabled.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
2014-03-26 15:30:40 -04:00
Michael Crosby
cb12e80969 Add cpuset.cpus to cgroups and native driver options
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-24 05:33:11 +00:00
Michael Crosby
ea56bc4614 Change placement of readonly filesystem
We need to change it to read only at the very end so that bound,
copy dev nodes and other ops do not fail.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-21 14:17:17 +00:00
Michael Crosby
a740cd779e Allow containers to join the net namespace of other conatiners
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-21 00:48:17 +00:00
Michael Crosby
acff50596b Merge branch 'proppy-nsinit' into pluginflag
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-21 00:36:23 +00:00
Michael Crosby
0114737132 Add ability to work with individual namespaces
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-21 00:23:34 +00:00
Michael Crosby
67a1625791 Allow caps to be toggled in native driver with plugin flag
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-21 00:10:24 +00:00
Michael Crosby
f6a8719dd5 Dont use custom marshaling for caps and namespaces
This also adds an enabled field to the types so that they
can be easily toggled.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-20 23:09:01 +00:00
Johan Euphrosine
b00757fda6 libcontainer: remove duplicate imports
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-03-18 16:25:26 -07:00
Johan Euphrosine
fc0982872a libcontainer: goimports
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-03-18 16:18:34 -07:00
Johan Euphrosine
76d3c99530 libcontainer/nsinit/init: move mount namespace after network
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-03-18 16:18:04 -07:00
Johan Euphrosine
e50e99bb8b libcontainer/network: add netns strategy
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
2014-03-18 16:17:28 -07:00
Michael Crosby
0424993f6d Only unshare the mount namespace for execin
Fixes #4728
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-17 18:52:56 -07:00
unclejack
e4ef28500c Merge pull request #4710 from jimenez/4680-timeout_flag-fix
Disable timeout
2014-03-18 00:38:39 +02:00
Isabel Jimenez
c423739eb5 adding configuration for timeout and disable it by default
Docker-DCO-1.1-Signed-off-by: Isabel Jimenez <contact@isabeljimenez.com> (github: jimenez)
2014-03-17 15:12:02 -07:00
Timothy Hobbs
1cad0a1d6c Fix issue #4681 - No loopback interface within container when networking is disabled.
Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Remove loopback code from veth strategy

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Looback strategy: Get rid of uneeded code in Create
Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Use append when building network strategy list

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Swap loopback and veth strategies in Networks list

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

Revert "Swap loopback and veth strategies in Networks list"

This reverts commit 3b8b2c8454171d79bed5e9a80165172617e92fc7.

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)

When initializing networks, only return from the loop if there is an error

Docker-DCO-1.1-Signed-off-by: Timothy Hobbs <timothyhobbs@seznam.cz> (github: https://github.com/timthelion)
2014-03-17 22:01:24 +01:00
Guillaume J. Charmes
dce2f20bec Merge pull request #4645 from crosbymichael/add-logger
Add logger to libcontainer
2014-03-17 11:30:14 -07:00
Guillaume J. Charmes
c838fc9266 Merge pull request #4719 from philips/Capabilities-to-CapabilitiesMask
refactor(libcontainer): rename to CapabilitiesMask
2014-03-17 11:15:29 -07:00
Brandon Philips
c6b2c2f6b0 chore(libcontainer): small grammar fix in types_test
Someone probably got really used to typing er on the end of contain :)

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-03-17 11:07:29 -07:00
Brandon Philips
4f5c96a769 refactor(libcontainer): rename to CapabilitiesMask
The Capabilities field on libcontainer is actually used as a mask.
Rename the field so that this is more clear.

Docker-DCO-1.1-Signed-off-by: Brandon Philips <brandon.philips@coreos.com> (github: philips)
2014-03-17 11:07:12 -07:00
unclejack
191a9c1ff3 Merge pull request #4672 from vieux/update_godoc_mflags
update godoc and add MAINTAINERS for mflags
2014-03-17 19:30:58 +02:00
Michael Crosby
a518a10209 Send sigterm to child instead of sigkill
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-14 15:42:05 -07:00
Victor Vieux
eac9cae74d update godoc and add MAINTAINERS for mflags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-14 17:35:41 +00:00
Michael Crosby
9183242a5d Add stderr log ouput if in debug
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-14 09:55:05 -07:00
Michael Crosby
f7eec3dd13 Add initial logging to libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-14 09:55:05 -07:00
Michael Crosby
ff10ab55d2 Update libcontainer readme and todo list
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-13 15:18:08 -07:00
Michael Crosby
aca132a1dd Merge pull request #4656 from crosbymichael/fix-ptmx-link
Always symlink /dev/ptmx for libcontainer
2014-03-13 14:57:17 -07:00
Guillaume J. Charmes
2a30a1a2f3 Merge pull request #4422 from alexlarsson/internal-mounts
Move all bind-mounts in the container inside the namespace
2014-03-13 14:55:29 -07:00
Michael Crosby
935520b224 Always symlink /dev/ptmx for libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-13 14:31:09 -07:00
Victor Vieux
26f4981284 Merge pull request #4624 from creack/fix_apparmor_init
Fix issue when /etc/apparmor.d does not exists
2014-03-13 14:04:13 -07:00
Alexander Larsson
eebaba3215 Move all bind-mounts in the container inside the namespace
This moves the bind mounts like /.dockerinit, /etc/hostname, volumes,
etc into the container namespace, by setting them up using lxc.

This is useful to avoid littering the global namespace with a lot of
mounts that are internal to each container and are not generally
needed on the outside. In particular, it seems that having a lot of
mounts is problematic wrt scaling to a lot of containers on systems
where the root filesystem is mounted --rshared.

Note that the "private" option is only supported by the native driver, as
lxc doesn't support setting this. This is not a huge problem, but it does
mean that some mounts are unnecessarily shared inside the container if you're
using the lxc driver.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
2014-03-13 20:01:29 +01:00
Guillaume J. Charmes
87b153606a Use BSD raw mode on darwin. Fixes nano, tmux and others
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-13 11:11:02 -07:00
Guillaume J. Charmes
3e89864534 Fix issue when /etc/apparmor.d does not exists
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-12 11:13:24 -07:00
Victor Vieux
f7fe084946 improve deprecation message
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-12 00:51:46 +00:00
Guillaume J. Charmes
02be9306bc Update email + add self to pkg/signal
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-10 20:26:45 -07:00
Kato Kazuyoshi
3f25da9dd5 Like signal_linux.go, we don't have import os and os/signal
Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
2014-03-11 23:14:58 +09:00
Michael Crosby
4631153f90 Merge pull request #4563 from creack/signal-improvment
Signal improvments
2014-03-10 17:59:17 -07:00
Michael Crosby
4125e1ccc3 Merge pull request #4515 from vieux/improve_sort_flags
improve alpha sort in mflag
2014-03-10 17:45:41 -07:00
Guillaume J. Charmes
2433bf6372 Make docker use the signal pkg with strings
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-10 17:36:47 -07:00
Guillaume J. Charmes
16d0b6b959 Create portable signalMap
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-10 17:36:41 -07:00
Guillaume J. Charmes
db6b150d99 Move signal to pkg
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
2014-03-10 17:36:32 -07:00
srid
115f88b346 nsinit: prefix errors with their source
Docker-DCO-1.1-Signed-off-by: Sridhar Ratnakumar <github@srid.name> (github: srid)
2014-03-10 17:08:50 -07:00
unclejack
374c3a3d3f Merge pull request #3985 from creack/add_freebsd_support
Add freebsd client support
2014-03-11 00:58:30 +02:00
Guillaume J. Charmes
10ae745ed8 Update bsd specs
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume.charmes@docker.com> (github: creack)
2014-03-10 15:19:08 -07:00
Victor Vieux
d9eb03d2ef move opts out of pkg because it's related to docker
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-10 21:10:23 +00:00
Victor Vieux
ff054ba1e2 remove utils.go
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-10 21:06:27 +00:00
Guillaume J. Charmes
fcd7612643 Merge branch 'master' into add_freebsd_support
Conflicts:
	archive/archive.go
	archive/start_unsupported.go
2014-03-10 13:20:49 -07:00
Victor Vieux
572ce1c6a9 handle capital
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
2014-03-07 23:40:45 +00:00
Michael Crosby
da605a43d6 Add env var to toggle pivot root or ms_move
Use the  DOCKER_RAMDISK env var to tell the native driver not to use
a pivot root when setting up the rootfs of a container.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
2014-03-06 19:30:52 -08:00