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

Fix issue when /etc/apparmor.d does not exists

Docker-DCO-1.1-Signed-off-by: Guillaume J. Charmes <guillaume@charmes.net> (github: creack)
This commit is contained in:
Guillaume J. Charmes 2014-03-12 11:13:24 -07:00
parent 63dee4ebc4
commit 6a325f1c7a
No known key found for this signature in database
GPG key ID: B33E4642CB6E3FF3

View file

@ -5,6 +5,7 @@ import (
"io/ioutil"
"os"
"os/exec"
"path"
)
const DefaultProfilePath = "/etc/apparmor.d/docker"
@ -85,6 +86,11 @@ func InstallDefaultProfile() error {
return nil
}
// Make sure /etc/apparmor.d exists
if err := os.MkdirAll(path.Dir(DefaultProfilePath), 0755); err != nil {
return err
}
if err := ioutil.WriteFile(DefaultProfilePath, []byte(DefaultProfile), 0644); err != nil {
return err
}