Relabel container termination log if SELinux is enabled

This commit is contained in:
Paul Morie 2016-10-24 18:41:16 -04:00
parent 7fb99442a6
commit 42ff2b3890

View File

@ -666,6 +666,13 @@ func (dm *DockerManager) runContainer(
} else { } else {
fs.Close() // Close immediately; we're just doing a `touch` here fs.Close() // Close immediately; we're just doing a `touch` here
b := fmt.Sprintf("%s:%s", containerLogPath, container.TerminationMessagePath) 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) binds = append(binds, b)
} }
} }