Skip to content

Commit

Permalink
docs: some minor touch-ups in checkpoint reference
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <[email protected]>
(cherry picked from commit 8c73a93)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Oct 11, 2021
1 parent 8260476 commit adb01ca
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions docs/reference/commandline/checkpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ checkpoint and restore in Docker is available in this

### Installing CRIU

If you use a Debian system, you can add the CRIU PPA and install with apt-get
If you use a Debian system, you can add the CRIU PPA and install with `apt-get`
[from the criu launchpad](https://launchpad.net/~criu/+archive/ubuntu/ppa).

Alternatively, you can [build CRIU from source](https://criu.org/Installation).

You need at least version 2.0 of CRIU to run checkpoint/restore in Docker.
You need at least version 2.0 of CRIU to run checkpoint and restore in Docker.

### Use cases for checkpoint & restore
### Use cases for checkpoint and restore

This feature is currently focused on single-host use cases for checkpoint and
restore. Here are a few:
Expand All @@ -35,21 +35,22 @@ restore. Here are a few:
- "Rewinding" processes to an earlier point in time
- "Forensic debugging" of running processes

Another primary use case of checkpoint & restore outside of Docker is the live
Another primary use case of checkpoint and restore outside of Docker is the live
migration of a server from one machine to another. This is possible with the
current implementation, but not currently a priority (and so the workflow is
not optimized for the task).

### Using checkpoint & restore
### Using checkpoint and restore

A new top level command `docker checkpoint` is introduced, with three subcommands:
- `create` (creates a new checkpoint)
- `ls` (lists existing checkpoints)
- `rm` (deletes an existing checkpoint)

Additionally, a `--checkpoint` flag is added to the container start command.
- `docker checkpoint create` (creates a new checkpoint)
- `docker checkpoint ls` (lists existing checkpoints)
- `docker checkpoint rm` (deletes an existing checkpoint)

The options for checkpoint create:
Additionally, a `--checkpoint` flag is added to the `docker container start` command.

The options for `docker checkpoint create`:

```console
Usage: docker checkpoint create [OPTIONS] CONTAINER CHECKPOINT
Expand All @@ -66,7 +67,7 @@ And to restore a container:
Usage: docker start --checkpoint CHECKPOINT_ID [OTHER OPTIONS] CONTAINER
```

Example of using checkpoint & restore on a container:
Example of using checkpoint and restore on a container:

```console
$ docker run --security-opt=seccomp:unconfined --name cr -d busybox /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
Expand All @@ -79,7 +80,7 @@ $ docker start --checkpoint checkpoint1 cr
abc0123
```

This process just logs an incrementing counter to stdout. If you `docker logs`
This process just logs an incrementing counter to stdout. If you run `docker logs`
in between running/checkpoint/restoring you should see that the counter
increases while the process is running, stops while it's checkpointed, and
resumes from the point it left off once you restore.
Expand Down

0 comments on commit adb01ca

Please sign in to comment.