Skip to content

Commit

Permalink
Relabel config files.
Browse files Browse the repository at this point in the history
Without relabel these files, SELinux-enabled containers will show
"permission denied" errors for configuration files mounted with
`docker server create ... --config ... ...`.

Signed-off-by: Wenxuan Zhao <viz@linux.com>
  • Loading branch information
vizv committed Sep 5, 2017
1 parent 975675e commit 472c03a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions daemon/container_operations_unix.go
Expand Up @@ -307,6 +307,8 @@ func (daemon *Daemon) setupConfigDir(c *container.Container) (setupErr error) {
if err := os.Chown(fPath, rootIDs.UID+uid, rootIDs.GID+gid); err != nil {
return errors.Wrap(err, "error setting ownership for config")
}

label.Relabel(fPath, c.MountLabel, false)
}

return nil
Expand Down

0 comments on commit 472c03a

Please sign in to comment.