Merge pull request #1623 from awprice/system-mount-skip

mounts: fix isSystemMount check for mountSharedDirMounts
This commit is contained in:
James O. D. Hunt 2019-05-09 09:38:11 +01:00 committed by GitHub
commit bb44f65a68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -519,11 +519,12 @@ func (c *Container) mountSharedDirMounts(hostSharedDir, guestSharedDir string) (
var sharedDirMounts []Mount
var ignoredMounts []Mount
for idx, m := range c.mounts {
if isSystemMount(m.Destination) {
if !(IsDockerVolume(m.Source) || Isk8sHostEmptyDir(m.Source)) {
// Skip mounting certain system paths from the source on the host side
// into the container as it does not make sense to do so.
// Example sources could be /sys/fs/cgroup etc.
if isSystemMount(m.Source) {
continue
}
}
if m.Type != "bind" {
continue