Skip to content

Commit 56e5910

Browse files
authored
Merge pull request #3267 from thaJeztah/move_experimental_docs
docs: move checkpoint/restore doc from experimental into reference
2 parents 1fdafcd + aa89e68 commit 56e5910

2 files changed

Lines changed: 39 additions & 28 deletions

File tree

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
# Docker Checkpoint & Restore
1+
---
2+
title: docker checkpoint
3+
description: "The checkpoint command description and usage"
4+
keywords: experimental, checkpoint, restore, criu
5+
experimental: true
6+
---
27

3-
Checkpoint & Restore is a new feature that allows you to freeze a running
8+
## Description
9+
10+
Checkpoint and Restore is an experimental feature that allows you to freeze a running
411
container by checkpointing it, which turns its state into a collection of files
512
on disk. Later, the container can be restored from the point it was frozen.
613

@@ -9,16 +16,16 @@ external dependency of this feature. A good overview of the history of
916
checkpoint and restore in Docker is available in this
1017
[Kubernetes blog post](https://kubernetes.io/blog/2015/07/how-did-quake-demo-from-dockercon-work/).
1118

12-
## Installing CRIU
19+
### Installing CRIU
1320

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

17-
Alternatively, you can [build CRIU from source](http://criu.org/Installation).
24+
Alternatively, you can [build CRIU from source](https://criu.org/Installation).
1825

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

21-
## Use cases for checkpoint & restore
28+
### Use cases for checkpoint & restore
2229

2330
This feature is currently focused on single-host use cases for checkpoint and
2431
restore. Here are a few:
@@ -33,7 +40,7 @@ migration of a server from one machine to another. This is possible with the
3340
current implementation, but not currently a priority (and so the workflow is
3441
not optimized for the task).
3542

36-
## Using checkpoint & restore
43+
### Using checkpoint & restore
3744

3845
A new top level command `docker checkpoint` is introduced, with three subcommands:
3946
- `create` (creates a new checkpoint)
@@ -44,45 +51,51 @@ Additionally, a `--checkpoint` flag is added to the container start command.
4451

4552
The options for checkpoint create:
4653

47-
Usage: docker checkpoint create [OPTIONS] CONTAINER CHECKPOINT
54+
```console
55+
Usage: docker checkpoint create [OPTIONS] CONTAINER CHECKPOINT
4856

49-
Create a checkpoint from a running container
57+
Create a checkpoint from a running container
5058

51-
--leave-running=false Leave the container running after checkpoint
52-
--checkpoint-dir Use a custom checkpoint storage directory
59+
--leave-running=false Leave the container running after checkpoint
60+
--checkpoint-dir Use a custom checkpoint storage directory
61+
```
5362

5463
And to restore a container:
5564

56-
Usage: docker start --checkpoint CHECKPOINT_ID [OTHER OPTIONS] CONTAINER
57-
65+
```console
66+
Usage: docker start --checkpoint CHECKPOINT_ID [OTHER OPTIONS] CONTAINER
67+
```
5868

59-
A simple example of using checkpoint & restore on a container:
69+
Example of using checkpoint & restore on a container:
6070

61-
$ 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'
62-
> abc0123
71+
```console
72+
$ 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'
73+
abc0123
6374

64-
$ docker checkpoint create cr checkpoint1
75+
$ docker checkpoint create cr checkpoint1
6576

66-
# <later>
67-
$ docker start --checkpoint checkpoint1 cr
68-
> abc0123
77+
# <later>
78+
$ docker start --checkpoint checkpoint1 cr
79+
abc0123
80+
```
6981

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

75-
## Current limitation
87+
### Known limitations
7688

7789
seccomp is only supported by CRIU in very up to date kernels.
7890

7991
External terminal (i.e. `docker run -t ..`) is not supported at the moment.
8092
If you try to create a checkpoint for a container with an external terminal,
8193
it would fail:
8294

83-
$ docker checkpoint create cr checkpoint1
84-
Error response from daemon: Cannot checkpoint container c1: rpc error: code = 2 desc = exit status 1: "criu failed: type NOTIFY errno 0\nlog file: /var/lib/docker/containers/eb62ebdbf237ce1a8736d2ae3c7d88601fc0a50235b0ba767b559a1f3c5a600b/checkpoints/checkpoint1/criu.work/dump.log\n"
85-
86-
$ cat /var/lib/docker/containers/eb62ebdbf237ce1a8736d2ae3c7d88601fc0a50235b0ba767b559a1f3c5a600b/checkpoints/checkpoint1/criu.work/dump.log
87-
Error (mount.c:740): mnt: 126:./dev/console doesn't have a proper root mount
95+
```console
96+
$ docker checkpoint create cr checkpoint1
97+
Error response from daemon: Cannot checkpoint container c1: rpc error: code = 2 desc = exit status 1: "criu failed: type NOTIFY errno 0\nlog file: /var/lib/docker/containers/eb62ebdbf237ce1a8736d2ae3c7d88601fc0a50235b0ba767b559a1f3c5a600b/checkpoints/checkpoint1/criu.work/dump.log\n"
8898

99+
$ cat /var/lib/docker/containers/eb62ebdbf237ce1a8736d2ae3c7d88601fc0a50235b0ba767b559a1f3c5a600b/checkpoints/checkpoint1/criu.work/dump.log
100+
Error (mount.c:740): mnt: 126:./dev/console doesn't have a proper root mount
101+
```

experimental/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ please feel free to provide any feedback on these features you wish.
1111

1212
## Use Docker experimental
1313

14-
Experimental features are now included in the standard Docker binaries as of
15-
version 1.13.0.
1614
To enable experimental features, start the Docker daemon with the
1715
`--experimental` flag or enable the daemon flag in the
1816
`/etc/docker/daemon.json` configuration file:
@@ -39,5 +37,5 @@ Checkpoint and restore support for Containers.
3937
Metrics (Prometheus) output for basic container, image, and daemon operations.
4038

4139
* [External graphdriver plugins](../docs/extend/plugins_graphdriver.md)
42-
* [Checkpoint & Restore](checkpoint-restore.md)
40+
* [Checkpoint & Restore](../docs/reference/commandline/checkpoint-restore.md)
4341
* [Docker build with --squash argument](../docs/reference/commandline/build.md#squash-an-images-layers---squash-experimental)

0 commit comments

Comments
 (0)