github.com/rhatdan/docker@v0.7.7-0.20180119204836-47a0dcbcd20a/daemon/container_linux.go (about) 1 //+build !windows 2 3 package daemon 4 5 import ( 6 "github.com/docker/docker/container" 7 "github.com/docker/docker/errdefs" 8 ) 9 10 func (daemon *Daemon) saveApparmorConfig(container *container.Container) error { 11 container.AppArmorProfile = "" //we don't care about the previous value. 12 13 if !daemon.apparmorEnabled { 14 return nil // if apparmor is disabled there is nothing to do here. 15 } 16 17 if err := parseSecurityOpt(container, container.HostConfig); err != nil { 18 return errdefs.InvalidParameter(err) 19 } 20 21 if !container.HostConfig.Privileged { 22 if container.AppArmorProfile == "" { 23 container.AppArmorProfile = defaultApparmorProfile 24 } 25 26 } else { 27 container.AppArmorProfile = "unconfined" 28 } 29 return nil 30 }