From 032aca342e96cc104c5be140da826605c7403f3c Mon Sep 17 00:00:00 2001 From: boucher Date: Sat, 18 Apr 2015 18:37:39 -0700 Subject: [PATCH] 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 (github: boucher) --- container_linux.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/container_linux.go b/container_linux.go index dc75de1d..e35f7021 100644 --- a/container_linux.go +++ b/container_linux.go @@ -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)