mirror of https://github.com/docker/docs.git
Merge pull request #9438 from crosbymichael/label-std-mounts
Label std mounts
This commit is contained in:
commit
bdaf562b4c
|
@ -15,6 +15,7 @@ import (
|
||||||
"github.com/docker/docker/pkg/chrootarchive"
|
"github.com/docker/docker/pkg/chrootarchive"
|
||||||
"github.com/docker/docker/pkg/symlink"
|
"github.com/docker/docker/pkg/symlink"
|
||||||
"github.com/docker/docker/volumes"
|
"github.com/docker/docker/volumes"
|
||||||
|
"github.com/docker/libcontainer/label"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Mount struct {
|
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})
|
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
|
// Mount user specified volumes
|
||||||
// Note, these are not private because you may want propagation of (un)mounts from host
|
// 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
|
// volumes. For instance if you use -v /usr:/usr and the host later mounts /usr/share you
|
||||||
|
|
Loading…
Reference in New Issue