Exclude the root path from mount point paths.
This change was necessary for me to get criu/libcontainer running inside of Docker. Docker-DCO-1.1-Signed-off-by: Ross Boucher <rboucher@gmail.com> (github: boucher)
This commit is contained in:
parent
328786f70e
commit
032aca342e
|
@ -327,7 +327,13 @@ func (c *linuxContainer) Checkpoint(imagePath string) error {
|
|||
}
|
||||
for _, m := range c.config.Mounts {
|
||||
if m.Device == "bind" {
|
||||
mountDest := m.Destination
|
||||
if strings.HasPrefix(mountDest, c.config.Rootfs) {
|
||||
mountDest = mountDest[len(c.config.Rootfs):]
|
||||
}
|
||||
|
||||
extMnt := new(criurpc.ExtMountMap)
|
||||
extMnt.Key = proto.String(mountDest)
|
||||
extMnt.Key = proto.String(m.Destination)
|
||||
extMnt.Val = proto.String(m.Destination)
|
||||
req.Opts.ExtMnt = append(req.Opts.ExtMnt, extMnt)
|
||||
|
|
Loading…
Reference in New Issue