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)
This commit is contained in:
Guillaume J. Charmes
2014-04-08 11:09:31 -07:00
parent 1bcb9ce69e
commit 4f828d67f0
2 changed files with 37 additions and 7 deletions
+5 -3
View File
@@ -21,8 +21,9 @@ import (
)
const (
DriverName = "native"
Version = "0.1"
DriverName = "native"
Version = "0.1"
BackupApparmorProfilePath = "apparmor/docker.back" // relative to docker root
)
func init() {
@@ -66,7 +67,8 @@ func NewDriver(root, initPath string) (*driver, error) {
if err := os.MkdirAll(root, 0700); err != nil {
return nil, err
}
if err := apparmor.InstallDefaultProfile(); err != nil {
// native driver root is at docker_root/execdriver/native. Put apparmor at docker_root
if err := apparmor.InstallDefaultProfile(filepath.Join(root, "../..", BackupApparmorProfilePath)); err != nil {
return nil, err
}
return &driver{