Commit Graph

158 Commits

Author SHA1 Message Date
4269c4b6a6 Ignore isnot exists errors for proc paths
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d5c9f61ecc1c8167322a8cc3b41f29a35c80b9b8
Component: engine
2014-04-24 10:35:20 -07:00
72d2138bac Update init for new apparmor import path
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: fa5cabf9fe9e257d64638043ca2fd08a7bf96cb3
Component: engine
2014-04-24 10:35:20 -07:00
bccf8f7f86 Update container.json and readme
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 2d31aeb911fc94baa88f975110c5ccd45d041acb
Component: engine
2014-04-24 10:35:20 -07:00
8ab9384720 Move capabilities into security pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 7a0b3610664c2269fd5932f294adae72e6e54020
Component: engine
2014-04-24 10:35:20 -07:00
28044eef7b Move mounts into types.go
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 156987c118f6f4067794e09e90aabeee0002d05c
Component: engine
2014-04-24 10:35:20 -07:00
c05360ff3b Move rest of console functions to pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: a949d39f195e7b87288b10b0ef31843e6a3d8eb0
Component: engine
2014-04-24 10:35:20 -07:00
0099e7d236 Refactor mounts into pkg to make changes easier
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 05b611574f85c7ff7d479e04e01ac2b57b233591
Component: engine
2014-04-24 10:35:20 -07:00
0cfbbc14e7 Move console into its own package
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: de3d51b0a824e31d7e245aed958d53f436456699
Component: engine
2014-04-24 10:35:20 -07:00
a750afc31e Mount over dev and only copy allowed nodes in
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5ba1242bdc309352c2b0b9a1ef9e07fe835e4857
Component: engine
2014-04-24 10:35:20 -07:00
20ba5d97da No not mount sysfs by default for non privilged containers
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 81e5026a6afb282589704fd5f6bcac9ed50108ea
Component: engine
2014-04-24 10:35:20 -07:00
9da373d6b1 Add restrictions to proc in libcontainer
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 60a90970bc4add3547064004f08c19ab5027141b
Component: engine
2014-04-24 10:35:19 -07:00
4b4b1b7313 Move apparmor into security sub dir
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: d26ea78e42ebf18219b88e01c6252f30aa764aa2
Component: engine
2014-04-24 10:35:19 -07:00
e178abd17a Merge pull request #5328 from crosbymichael/refactor-cgroups
Refactor cgroups into subsystems and support metrics
Upstream-commit: 781671245778c8cfdde1892204bb10899020b0d8
Component: engine
2014-04-21 14:06:17 -07:00
fec63c3950 Move raw cgroups into fs package (filesystem)
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 06db0604e5e5438dc14e13a069ebddcab7bb4bc6
Component: engine
2014-04-18 21:34:26 -07:00
91235494a6 Move systemd code into pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: ec43ec50b44cff3f043c78cad97466c68e2ba8cd
Component: engine
2014-04-18 21:30:08 -07:00
0b62a2c5be Refactor cgroups file locations
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 42fb2973c690fe4e4f65da235ce4dfa4c388e8a3
Component: engine
2014-04-18 21:14:58 -07:00
ebb2ad0565 Move apparmor to top level pkg
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 052cc5a6378ee4bbe1ef79e5632e2439d68ddbde
Component: engine
2014-04-13 23:33:25 +00:00
b85f5791ad Use apparmor_parser directly
The current load script does alot of things.  If it does not find the
parser loaded on the system it will just exit 0 and not load the
profile.  We think it should fail loudly if it cannot load the profile
and apparmor is enabled on the system.
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 5f4bc4f916f433a4ba258980a6c2fbdbd76d64f3
Component: engine
2014-04-13 23:31:10 +00:00
4ea377c1c7 Merge pull request #5143 from kzys/ns-nil
Avoid "invalid memory address or nil pointer dereference" panic
Upstream-commit: b8c10d8af254a6200de642e246b5a0d9de0dfca8
Component: engine
2014-04-10 11:07:35 -07:00
39bbc0e47b Merge pull request #5131 from crosbymichael/shm-mode
Change shm mode to 1777
Upstream-commit: 042a50a8fe1e54ce602d1c517091381c209eabf3
Component: engine
2014-04-10 07:50:32 -07:00
b4f2aeb444 Merge pull request #5115 from alexlarsson/fix-libcontainer-network-rhel6
Fix libcontainer network support on rhel6
Upstream-commit: 5b242c95da303ee26d3119678340050670fed45a
Component: engine
2014-04-10 07:45:12 -07:00
9a57be369c Avoid "invalid memory address or nil pointer dereference" panic
libcontainer.GetNamespace returns nil on FreeBSD because
libcontainer.namespaceList is empty. In this case, Namespaces#Get should
return nil instead of being panic.

Docker-DCO-1.1-Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com> (github: kzys)
Upstream-commit: c5226d94fab4e261fe2407262d9b5177326d4062
Component: engine
2014-04-10 22:07:29 +09:00
7b99942ebd Fix libcontainer network support on rhel6
It seems that netlink in older kernels, including RHEL6, does not
support RTM_SETLINK with IFLA_MASTER. It just silently ignores it, reporting
no error, causing netlink.NetworkSetMaster() to not do anything yet
return no error.

We fix this by introducing and using AddToBridge() in a very similar manner
to CreateBridge(), which use the old ioctls directly.

This fixes https://github.com/dotcloud/docker/issues/4668

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Upstream-commit: 59c1b2880be8fb9d9a632fa42a10097c1580591a
Component: engine
2014-04-09 15:44:18 +02:00
855754fa1c Change shm mode to 1777
Fixes #5126
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 986cf931c38b8cdc51da44af0313502ca1156cfc
Component: engine
2014-04-09 10:53:32 +00:00
7d69f5cd99 Check for apparmor enabled on host to populate profile
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 87f0d63fb2ede63d263d8e8285b83a7f7d12bbf3
Component: engine
2014-04-09 10:22:17 +00:00
c2ee8e861a Backup current docker apparmor profile and replace it with the new one
Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
Upstream-commit: 4f828d67f00449182eaada50dfba37e00f8f01ef
Component: engine
2014-04-08 11:09:31 -07:00
06d3bd0a02 Merge pull request #5049 from Supermathie/aa-fix
apparmor: docker-default: Include base abstraction
Upstream-commit: 8cfbc4466151666417a1245422ce0cb773d6d260
Component: engine
2014-04-07 21:34:01 -07:00
a8f5408909 Merge pull request #5025 from dstine/readme-fix
fixed two readme typos
Upstream-commit: 1d2126be6cf9937ee5ec2174aa2e2d02c07eb40c
Component: engine
2014-04-07 19:31:16 -07:00
9045165305 fixed three more typos
Upstream-commit: 9c4d10b9a91b9f11794ceb094331496c733410bb
Component: engine
2014-04-07 22:09:15 -04:00
ba83763b84 Ensure that ro mounts are remounted
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: b6042f252dd8a0c7a75da481b667f89c2e4ab071
Component: engine
2014-04-07 18:23:22 -07:00
22496306d5 apparmor: pull in variables from tunables/global
The variables that were defined at the top of the apparmor profile are best
pulled in via the <tunables/global> include.

Docker-DCO-1.1-Signed-off-by: Michael Brown <michael.brown@discourse.org> (github: Supermathie)
Upstream-commit: 726206f2aa45b8a537ae6d6c819f21befc2e0aca
Component: engine
2014-04-07 03:04:27 -04:00
ee2b8b0673 apparmor: abstractions/base expects pid variable
Add 'pid' variable pointing to 'self' to allow parsing of profile to succeed

Docker-DCO-1.1-Signed-off-by: Michael Brown <michael.brown@discourse.org> (github: Supermathie)
Upstream-commit: 320b3e0d211d389addda02998a0f47839827b2af
Component: engine
2014-04-07 02:47:43 -04:00
70e9ec0c23 apparmor: docker-default: Include base abstraction
Encountered problems on 14.04 relating to signals between container
processes being blocked by apparmor. The base abstraction contains
appropriate rules to allow this communication.

Docker-DCO-1.1-Signed-off-by: Michael Brown <michael.brown@discourse.org> (github: Supermathie)
Upstream-commit: e35c23311fce853fab318527789f11cc8c150ea2
Component: engine
2014-04-07 02:19:38 -04:00
435555c277 fixed two readme typos
Upstream-commit: bea71245c8165e0dfdc6b2485c548c04f4d3edd3
Component: engine
2014-04-04 08:12:17 -04:00
f11e4187aa Remove loopback setup for native driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
Upstream-commit: 18ef3cc24a933cbf403c2aaf8b374cfc84a722a4
Component: engine
2014-04-02 13:12:52 +00:00
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
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
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
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
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
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
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
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