diff --git a/namespaces/execin.go b/namespaces/execin.go index 8b81edec..53e676ac 100644 --- a/namespaces/execin.go +++ b/namespaces/execin.go @@ -12,6 +12,7 @@ import ( "syscall" "github.com/docker/libcontainer" + "github.com/docker/libcontainer/apparmor" "github.com/docker/libcontainer/cgroups" "github.com/docker/libcontainer/label" "github.com/docker/libcontainer/syncpipe" @@ -96,6 +97,10 @@ func FinalizeSetns(container *libcontainer.Config, args []string) error { return err } + if err := apparmor.ApplyProfile(container.AppArmorProfile); err != nil { + return fmt.Errorf("set apparmor profile %s: %s", container.AppArmorProfile, err) + } + if container.ProcessLabel != "" { if err := label.SetProcessLabel(container.ProcessLabel); err != nil { return err