Merge pull request #9438 from crosbymichael/label-std-mounts
Label std mounts
This commit is contained in:
commit
bdaf562b4c
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue