diff --git a/g3doc/user_guide/checkpoint_restore.md b/g3doc/user_guide/checkpoint_restore.md index 5d685bdb9..245470aaa 100644 --- a/g3doc/user_guide/checkpoint_restore.md +++ b/g3doc/user_guide/checkpoint_restore.md @@ -56,32 +56,22 @@ runsc restore --image-path= ## How to use checkpoint/restore in Docker: -Currently checkpoint/restore through `runsc` is not entirely compatible with -Docker, although there has been progress made from both gVisor and Docker to -enable compatibility. Here, we document the ideal workflow. - Run a container: ```bash -docker run [options] --runtime=runsc ` +docker run [options] --runtime=runsc --name= ``` -Checkpoint a container: +Checkpoint the container: ```bash -docker checkpoint create ` +docker checkpoint create ``` -Create a new container into which to restore: +Restore into the same container: ```bash -docker create [options] --runtime=runsc -``` - -Restore a container: - -```bash -docker start --checkpoint --checkpoint-dir= +docker start --checkpoint ``` ### Issues Preventing Compatibility with Docker @@ -93,9 +83,7 @@ docker start --checkpoint --checkpoint-dir= `--leave-running` flag. This issue is fixed in newer releases. - **Docker does not support restoration into new containers:** Docker currently expects the container which created the checkpoint to be the same - container used to restore which is not possible in runsc. When Docker - supports container migration and therefore restoration into new containers, - this will be the flow. + container used to restore. This is needed to support container migration. - **[Moby #37344][checkpoint-dir]:** Docker does not currently support the `--checkpoint-dir` flag but this will be required when restoring from a checkpoint made in another container. diff --git a/pkg/test/dockerutil/container.go b/pkg/test/dockerutil/container.go index 3e1e77d9c..0b0991f28 100644 --- a/pkg/test/dockerutil/container.go +++ b/pkg/test/dockerutil/container.go @@ -324,7 +324,7 @@ func (c *Container) Checkpoint(ctx context.Context, name string) error { return c.client.CheckpointCreate(ctx, c.Name, types.CheckpointCreateOptions{CheckpointID: name, Exit: true}) } -// Restore is analogous to 'docker start --checkname [name]'. +// Restore is analogous to 'docker start --checkpoint [name]'. func (c *Container) Restore(ctx context.Context, name string) error { return c.client.ContainerStart(ctx, c.id, types.ContainerStartOptions{CheckpointID: name}) }