diff --git a/daemon/mgr/container.go b/daemon/mgr/container.go index 0124e5ed3..984314c59 100644 --- a/daemon/mgr/container.go +++ b/daemon/mgr/container.go @@ -1880,24 +1880,28 @@ func (mgr *ContainerManager) generateMountPoints(ctx context.Context, c *Contain } }() - err = mgr.getMountPointFromVolumes(ctx, c, volumeSet) + // 1. read MountPoints from other containers + err = mgr.getMountPointFromContainers(ctx, c, volumeSet) if err != nil { - return errors.Wrap(err, "failed to get mount point from volumes") + return errors.Wrap(err, "failed to get mount point from containers") } - err = mgr.getMountPointFromImage(ctx, c, volumeSet) + // 2. read MountPoints from binds + err = mgr.getMountPointFromBinds(ctx, c, volumeSet) if err != nil { - return errors.Wrap(err, "failed to get mount point from image") + return errors.Wrap(err, "failed to get mount point from binds") } - err = mgr.getMountPointFromBinds(ctx, c, volumeSet) + // 3. read MountPoints from image + err = mgr.getMountPointFromImage(ctx, c, volumeSet) if err != nil { - return errors.Wrap(err, "failed to get mount point from binds") + return errors.Wrap(err, "failed to get mount point from image") } - err = mgr.getMountPointFromContainers(ctx, c, volumeSet) + // 4. read MountPoints from Config.Volumes + err = mgr.getMountPointFromVolumes(ctx, c, volumeSet) if err != nil { - return errors.Wrap(err, "failed to get mount point from containers") + return errors.Wrap(err, "failed to get mount point from volumes") } return nil