diff --git a/components/engine/client/container_copy.go b/components/engine/client/container_copy.go index 30ba6803f0..b7d5252ab2 100644 --- a/components/engine/client/container_copy.go +++ b/components/engine/client/container_copy.go @@ -30,7 +30,7 @@ func (cli *Client) ContainerStatPath(ctx context.Context, containerID, path stri } // CopyToContainer copies content into the container filesystem. -// Note that `content` must be a Reader for a TAR +// Note that `content` must be a Reader for a TAR archive func (cli *Client) CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error { query := url.Values{} query.Set("path", filepath.ToSlash(path)) // Normalize the paths used in the API. @@ -59,7 +59,7 @@ func (cli *Client) CopyToContainer(ctx context.Context, container, path string, } // CopyFromContainer gets the content from the container and returns it as a Reader -// to manipulate it in the host. It's up to the caller to close the reader. +// for a TAR archive to manipulate it in the host. It's up to the caller to close the reader. func (cli *Client) CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, types.ContainerPathStat, error) { query := make(url.Values, 1) query.Set("path", filepath.ToSlash(srcPath)) // Normalize the paths used in the API. diff --git a/components/engine/libcontainerd/client_daemon.go b/components/engine/libcontainerd/client_daemon.go index 7508968fd5..79b5e478be 100644 --- a/components/engine/libcontainerd/client_daemon.go +++ b/components/engine/libcontainerd/client_daemon.go @@ -147,7 +147,7 @@ func (c *client) Restore(ctx context.Context, id string, attachStdio StdioCallba rio, err = attachStdio(io) return rio, err }) - if err != nil && !strings.Contains(err.Error(), "no running task found") { + if err != nil && !errdefs.IsNotFound(errors.Cause(err)) { return false, -1, err } @@ -262,8 +262,9 @@ func (c *client) Start(ctx context.Context, id, checkpointDir string, withStdin func(_ context.Context, _ *containerd.Client, info *containerd.TaskInfo) error { info.Checkpoint = cp info.Options = &runctypes.CreateOptions{ - IoUid: uint32(uid), - IoGid: uint32(gid), + IoUid: uint32(uid), + IoGid: uint32(gid), + NoPivotRoot: os.Getenv("DOCKER_RAMDISK") != "", } return nil })