1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

skip apparmor with dind

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
This commit is contained in:
Victor Vieux 2014-05-01 21:52:29 +00:00
parent ae686c0486
commit de191e8632
2 changed files with 4 additions and 1 deletions

View file

@ -9,6 +9,9 @@
# Usage: dind CMD [ARG...] # Usage: dind CMD [ARG...]
# apparmor sucks and Docker needs to know that it's in a container (c) @tianon
export container=docker
# First, make sure that cgroups are mounted correctly. # First, make sure that cgroups are mounted correctly.
CGROUP=/sys/fs/cgroup CGROUP=/sys/fs/cgroup

View file

@ -13,7 +13,7 @@ import (
) )
func IsEnabled() bool { func IsEnabled() bool {
if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil { if _, err := os.Stat("/sys/kernel/security/apparmor"); err == nil && os.Getenv("container") == "" {
buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled") buf, err := ioutil.ReadFile("/sys/module/apparmor/parameters/enabled")
return err == nil && len(buf) > 1 && buf[0] == 'Y' return err == nil && len(buf) > 1 && buf[0] == 'Y'
} }