Relabel container termination log if SELinux is enabled

pull/6/head
Paul Morie 2016-10-24 18:41:16 -04:00
parent 7fb99442a6
commit 42ff2b3890
1 changed files with 7 additions and 0 deletions

View File

@ -666,6 +666,13 @@ func (dm *DockerManager) runContainer(
} else {
fs.Close() // Close immediately; we're just doing a `touch` here
b := fmt.Sprintf("%s:%s", containerLogPath, container.TerminationMessagePath)
// Have docker relabel the termination log path if SELinux is
// enabled.
if selinux.SELinuxEnabled() {
b += ":Z"
}
binds = append(binds, b)
}
}