Merge pull request #9438 from crosbymichael/label-std-mounts

Label std mounts
This commit is contained in:
Jessie Frazelle 2014-12-01 14:37:42 -08:00
commit bdaf562b4c

View file

@ -15,6 +15,7 @@ import (
"github.com/docker/docker/pkg/chrootarchive"
"github.com/docker/docker/pkg/symlink"
"github.com/docker/docker/volumes"
"github.com/docker/libcontainer/label"
)
type Mount struct {
@ -247,6 +248,12 @@ func (container *Container) setupMounts() error {
mounts = append(mounts, execdriver.Mount{Source: container.HostsPath, Destination: "/etc/hosts", Writable: true, Private: true})
}
for _, m := range mounts {
if err := label.SetFileLabel(m.Source, container.MountLabel); err != nil {
return err
}
}
// Mount user specified volumes
// Note, these are not private because you may want propagation of (un)mounts from host
// volumes. For instance if you use -v /usr:/usr and the host later mounts /usr/share you