Ignore isnot exists errors for proc paths
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
2ecea22c8c
commit
76a06effef
1 changed files with 6 additions and 1 deletions
|
@ -2,9 +2,11 @@ package restrict
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/dotcloud/docker/pkg/system"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
"github.com/dotcloud/docker/pkg/system"
|
||||||
)
|
)
|
||||||
|
|
||||||
const flags = syscall.MS_BIND | syscall.MS_REC | syscall.MS_RDONLY
|
const flags = syscall.MS_BIND | syscall.MS_REC | syscall.MS_RDONLY
|
||||||
|
@ -36,6 +38,9 @@ func Restrict(rootfs, empty string) error {
|
||||||
source = filepath.Join(rootfs, source)
|
source = filepath.Join(rootfs, source)
|
||||||
}
|
}
|
||||||
if err := system.Mount(source, dest, "bind", flags, ""); err != nil {
|
if err := system.Mount(source, dest, "bind", flags, ""); err != nil {
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
return fmt.Errorf("unable to mount %s over %s %s", source, dest, err)
|
return fmt.Errorf("unable to mount %s over %s %s", source, dest, err)
|
||||||
}
|
}
|
||||||
if err := system.Mount("", dest, "bind", flags|syscall.MS_REMOUNT, ""); err != nil {
|
if err := system.Mount("", dest, "bind", flags|syscall.MS_REMOUNT, ""); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue