Commit Graph

252 Commits

Author SHA1 Message Date
c93b9fc839 Merge pull request #4953 from rhatdan/selinux
These two patches should fix problems we see with running docker in the wild.
Upstream-commit: 9687c087ab09feb106b040628423e70b320a51e2
Component: engine
2014-04-02 16:36:41 -07:00
228e989bbd Merge pull request #4961 from creack/update_version_pkg
Update Version to not use string anymore
Upstream-commit: 93bb20816418f68d8a47f8252e664856f7b554b1
Component: engine
2014-04-01 18:37:25 -07:00
44b80d9793 Merge pull request #4902 from shykes/wozniak_is_not_boring
Steve Wozniak is not boring.
Upstream-commit: 431046e0f5ccf2a16c4530b996e035447ce37b63
Component: engine
2014-04-01 16:49:56 -07:00
d7e849e505 Merge pull request #4931 from crosbymichael/gen-mac-addr-for-bridge
Set bridge mac addr on supported kernels
Upstream-commit: ceed9382d0b361018a57ec96e163c3c30198cbd0
Component: engine
2014-04-02 02:47:56 +03:00
4675670b52 Merge pull request #4867 from crosbymichael/clean-shutdown
Cleanly shutdown docker
Upstream-commit: 30ff3fa954676bfc8f48b73093f3afa1473d146e
Component: engine
2014-04-02 01:48:03 +03:00
d9e5457b6e Update Version to not use string anymore
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: 3ee37f547f4685ab88bfc39517cc18c1911451e5
Component: engine
2014-04-01 15:46:52 -07:00
55905d7fbc Merge pull request #4942 from vieux/cleanup_dev_libcontainer
remove setupDev from libcontainer
Upstream-commit: 9cf89f854256eace2b8f446b16c4fbe22ffa61b1
Component: engine
2014-04-01 14:28:17 -07:00
b924033920 Merge pull request #4833 from crosbymichael/pluginflag
Add opts flag for fine grained control over drivers
Upstream-commit: b4b87413d8d3fd20073975bcc84603fa7853d316
Component: engine
2014-04-01 13:34:08 -07:00
94c4d19652 In certain cases, setting the process label will not happen.
When the code attempts to set the ProcessLabel, it checks if SELinux Is
enabled.  We have seen a case with some of our patches where the code
is fooled by the container to think that SELinux is not enabled.  Calling
label.Init before setting up the rest of the container, tells the library that
SELinux is enabled and everything works fine.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 2224e0d65adfbd08e53430a1d7c750491f788257
Component: engine
2014-04-01 13:30:10 -04:00
9da452cca1 Remove hard coding of SELinux labels on systems without proper selinux policy.
If a system is configured for SELinux but does not know about docker or
containers, then we want the transitions of the policy to work.  Hard coding
the labels causes docker to break on older Fedora and RHEL systems

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: f9b8161c60f58d383ca0eaf5a99865b83e4a41b8
Component: engine
2014-04-01 13:29:54 -04:00
d0b2920666 Don't send prctl to be consistent with other drivers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 283daced0c919be760947d44d7e46c80e1054d64
Component: engine
2014-04-01 07:12:50 +00:00
5f13c09028 Ensure a reliable way to kill ghost containers on reboot
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5bb82f6313d7f789783ffac854be85a44a56617e
Component: engine
2014-04-01 07:11:41 +00:00
5505d168ef remove setupDev from libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: d52d24dd801f3ffe1b894226b8dba613de59bd87
Component: engine
2014-04-01 00:28:44 +00:00
a4e4b56b6e Set bridge mac addr on supported kernels
Fixes #3200
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 4cdcea20474a9f42291fe6b6c6dee348343a7c05
Component: engine
2014-03-31 22:56:23 +00:00
2bae51a862 Add more women
Added Adele Goldstine, Erna Schneider Hoover, Grace Hopper, Jean Bartik,
Jean E. Sammet, Karen Spärck Jones, Radia Perlman and Sophie Wilson.

Thanks to @jamtur01 for Sophie Kowalevski, Hypatia, Jane Goodall, Maria
Mayer, Rosalind Franklin, Gertrude Elion, Elizabeth Blackwell,
Marie-Jeanne de Lalande, Maria Kirch, Maria Ardinghelli, Jane Colden,
June Almeida, Mary Leakey, Lise Meitner, Johanna Mestorf.

Thanks to @xamebax for Françoise Barré-Sinoussi, Rachel Carson, Barbara
McClintock, Ada Yonath.

Docker-DCO-1.1-Signed-off-by: Johannes 'fish' Ziemke <github@freigeist.org> (github: discordianfish)
Upstream-commit: 7808886744595af509b7b144890900674ea5ccfd
Component: engine
2014-03-31 19:44:57 +02:00
c91d38cde3 Steve Wozniak is not boring.
Docker-DCO-1.1-Signed-off-by: Solomon Hykes <solomon@docker.com> (github: shykes)
Upstream-commit: 04f5c75239cba156db70523bcd90657e5c7b5ddb
Component: engine
2014-03-29 00:48:47 +00:00
ae0da14a77 Merge pull request #4442 from ibuildthecloud/hairpin-nat
Support hairpin NAT without going through docker server
Upstream-commit: d2327006d659595e88da653e054f826401b05727
Component: engine
2014-03-27 18:09:42 -07:00
5f846085d9 cgroups: Add systemd implementation of cgroups
This implements cgroup.Apply() using the systemd apis.
We create a transient unit called "docker-$id.scope" that contains
the container processes. We also have a way to set unit specific
properties, currently only defining the Slice to put the
scope in.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 6c7835050e53b733181ddfca6152c358fd625400
Component: engine
2014-03-27 22:44:31 +01:00
a2c3f01761 Add systemd.SdBooted()
This is a conversion of sd_booted() from libsystemd to go and checks
if the system was booted with systemd.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 1296d5ce9ad43d8d833f6e5661da45aef6d4c26b
Component: engine
2014-03-27 22:44:31 +01:00
931e59cc5b pkg/systemd: Drop our copy-pasted version of go-systemd/activation
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: cb43fd007133fc05b6bb2b0d3d58fef8b1e60537
Component: engine
2014-03-27 22:44:31 +01:00
cf568a7031 cgroups: Join groups by writing to cgroups.procs, not tasks
cgroups.procs moves all the threads of the process, and "tasks" just
the one thread. I believe there is a risk that we move the main thread,
but then we accidentally fork off one of the other threads if the go
scheduler randomly switched to another thread. So, it seems safer (and
more correct) to use cgroups.procs.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 9294d7f2af6ecb7c18be11fb5043fad4a61d8f09
Component: engine
2014-03-27 21:47:47 +01:00
4a0326289d cgroups: Splity out Apply/Cleanup to separate file/interface
This leaves only the generic cgroup helper functions in cgroups.go and
will allow easy implementations of other cgroup managers.

This also wires up the call to Cleanup the cgroup which was missing
before.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 7f7d8419a71d49b25e4d38196b36e93b568bb61d
Component: engine
2014-03-27 21:47:47 +01:00
5ed6e1adb8 Fix compile and unit test errors after merge
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 2d270c4f06dbc2ee1293e3f81f6922df248ef8eb
Component: engine
2014-03-27 08:25:01 +00:00
f4111a1ccb 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)
Upstream-commit: eab56ac007b263708b5526609c8be2bc19881467
Component: engine
2014-03-27 08:00:18 +00:00
f757666ccd 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)
Upstream-commit: 4c4356692580afb3971094e322aea64abe0e2500
Component: engine
2014-03-26 15:30:40 -04:00
9d6d07c6ea Add cpuset.cpus to cgroups and native driver options
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 9a7be1b015a1ba79e5480d0ddddfa5954b994507
Component: engine
2014-03-24 05:33:11 +00:00
9fad5483e0 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)
Upstream-commit: 2c58a1e2886433a4266615b1f492f829e7a6f53f
Component: engine
2014-03-21 14:17:17 +00:00
ffa18d8ad0 Allow containers to join the net namespace of other conatiners
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: be5538d8a8820ac1192c7a5660e0d950927b42d0
Component: engine
2014-03-21 00:48:17 +00:00
b80ed35d06 Merge branch 'proppy-nsinit' into pluginflag
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 1bedae9107108156d6d272494f1ff27d8b4be590
Component: engine
2014-03-21 00:36:23 +00:00
c42d40863c Add ability to work with individual namespaces
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 70f3b9f4ce67ee54ec226814cdd26db01f69378d
Component: engine
2014-03-21 00:23:34 +00:00
44fe86670a 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)
Upstream-commit: 443a75d5f66e986e9d7740d3f2aaef080aef8ea0
Component: engine
2014-03-21 00:10:24 +00:00
3490f03690 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)
Upstream-commit: c5f9c4bd6933c806490e4f7cb52557cee154dbed
Component: engine
2014-03-20 23:09:01 +00:00
433a941c61 libcontainer: remove duplicate imports
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: 5dbfe310fe624c66714f8c5017692f528af4c87f
Component: engine
2014-03-18 16:25:26 -07:00
bf68195445 libcontainer: goimports
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: f58757a699cf47c3b8770e13f371e1bbf493b5b1
Component: engine
2014-03-18 16:18:34 -07:00
05b01b0f64 libcontainer/nsinit/init: move mount namespace after network
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: b10b950b110c93db34a399753706dc79c71b94d3
Component: engine
2014-03-18 16:18:04 -07:00
c37f607a5b libcontainer/network: add netns strategy
Docker-DCO-1.1-Signed-off-by: Johan Euphrosine <proppy@google.com> (github: proppy)
Upstream-commit: f52b2fdcbb29258c5b492fdb2479d473fcb42ca0
Component: engine
2014-03-18 16:17:28 -07:00
2d58b8bf60 Only unshare the mount namespace for execin
Fixes #4728
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 4b1513f9c394fbfdf21998db4318251b4e8b6bc0
Component: engine
2014-03-17 18:52:56 -07:00
0aaef1f844 Merge pull request #4710 from jimenez/4680-timeout_flag-fix
Disable timeout
Upstream-commit: fb503da34e2eae1aab3a54eed4c5a2374fa35c7d
Component: engine
2014-03-18 00:38:39 +02:00
e839931238 adding configuration for timeout and disable it by default
Docker-DCO-1.1-Signed-off-by: Isabel Jimenez <contact@isabeljimenez.com> (github: jimenez)
Upstream-commit: 25218f9b239784e6f38550a6e320bce56aaca3e1
Component: engine
2014-03-17 15:12:02 -07:00
ccebbeffe2 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)
Upstream-commit: 353df19ab7009f6555dee506841ae0b690a08768
Component: engine
2014-03-17 22:01:24 +01:00
4ff432cad1 Merge pull request #4645 from crosbymichael/add-logger
Add logger to libcontainer
Upstream-commit: 597e0812fb8a40cf73388bcc44e6be74035a9846
Component: engine
2014-03-17 11:30:14 -07:00
f1b6288e96 Merge pull request #4719 from philips/Capabilities-to-CapabilitiesMask
refactor(libcontainer): rename to CapabilitiesMask
Upstream-commit: 73f5aa87af0feb22570d1ea1b71ac58b874ac4cd
Component: engine
2014-03-17 11:15:29 -07:00
b1507c6b21 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)
Upstream-commit: ad7e7d612390d09d3a54fd82dda9687deb3b0cbe
Component: engine
2014-03-17 11:07:29 -07:00
ba77c9041d 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)
Upstream-commit: 128381e0f0372f10f88a847087aa91a972770c4b
Component: engine
2014-03-17 11:07:12 -07:00
2e43a87446 Merge pull request #4672 from vieux/update_godoc_mflags
update godoc and add MAINTAINERS for mflags
Upstream-commit: 555c1ef670c7f0dd9e1bd195ac6391e06e657f67
Component: engine
2014-03-17 19:30:58 +02:00
842270ca38 Send sigterm to child instead of sigkill
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 39037a91f85a4a072e5aa7e585d8c2f6b211df8a
Component: engine
2014-03-14 15:42:05 -07:00
2fa4f2c621 update godoc and add MAINTAINERS for mflags
Docker-DCO-1.1-Signed-off-by: Victor Vieux <victor.vieux@docker.com> (github: vieux)
Upstream-commit: a41f6d936754f66d1786fa5b840278443da8d93c
Component: engine
2014-03-14 17:35:41 +00:00
0d0170bb11 Add stderr log ouput if in debug
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 0e863a584a6edfa1c3ec383c586b646663b66bc7
Component: engine
2014-03-14 09:55:05 -07:00
3f944b4fd6 Add initial logging to libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 7294392c729de4c5884eb967f192b34a1d8857a7
Component: engine
2014-03-14 09:55:05 -07:00
0e6df3669c Update libcontainer readme and todo list
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: cbd2a30cd6185d1469f82f8b6693d6158c93d54a
Component: engine
2014-03-13 15:18:08 -07:00