Merge branch 'pr505'

This commit is contained in:
Darren Shepherd 2019-06-14 13:28:19 -07:00
commit e0d2bd3e2d
2 changed files with 7 additions and 3 deletions

View File

@ -42,13 +42,17 @@ func setupMount(target, dir string) error {
toCreate = filepath.Base(toCreate)
}
if err := os.MkdirAll(toCreate, 0700); err != nil {
return errors.Wrapf(err, "failed to create directory %s", toCreate)
}
logrus.Debug("Mounting none ", toCreate, " tmpfs")
if err := unix.Mount("none", toCreate, "tmpfs", 0, ""); err != nil {
return errors.Wrapf(err, "failed to mount tmpfs to %s", toCreate)
}
if err := os.MkdirAll(target, 0700); err != nil {
return errors.Wrapf(err, "failed to create directory %s")
return errors.Wrapf(err, "failed to create directory %s", target)
}
if dir == "" {
@ -56,7 +60,7 @@ func setupMount(target, dir string) error {
}
if err := os.MkdirAll(dir, 0700); err != nil {
return errors.Wrapf(err, "failed to create directory %s")
return errors.Wrapf(err, "failed to create directory %s", dir)
}
logrus.Debug("Mounting ", dir, target, " none bind")

View File

@ -128,7 +128,7 @@ func createChildOpt() (*child.Opt, error) {
opt.PipeFDEnvKey = pipeFD
opt.NetworkDriver = slirp4netns.NewChildDriver()
opt.PortDriver = portbuiltin.NewChildDriver(&logrusDebugWriter{})
opt.CopyUpDirs = []string{"/etc", "/run"}
opt.CopyUpDirs = []string{"/etc", "/run", "/var/lib"}
opt.CopyUpDriver = tmpfssymlink.NewChildDriver()
return opt, nil
}