Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: docker restart --checkpoint #39342

Open
MaxHorstmann opened this issue Jun 8, 2019 · 1 comment
Open

Feature request: docker restart --checkpoint #39342

MaxHorstmann opened this issue Jun 8, 2019 · 1 comment
Labels
area/checkpoint Related to (experimental) checkpoint/restore (CRIU)

Comments

@MaxHorstmann
Copy link

Description

If the Docker daemon is running in experimental mode, docker start accepts --checkpoint and --checkpoint-dir parameters to restore from a checkpoint:

Usage:	docker start [OPTIONS] CONTAINER [CONTAINER...]

Start one or more stopped containers

Options:
  -a, --attach                  Attach STDOUT/STDERR and forward signals
      --checkpoint string       Restore from this checkpoint
      --checkpoint-dir string   Use a custom checkpoint storage directory
      --detach-keys string      Override the key sequence for detaching a container
      --help                    Print usage
  -i, --interactive             Attach container's STDIN

However, docker restart does currently not accept --checkpoint and --checkpoint-dir:

Usage:	docker restart [OPTIONS] CONTAINER [CONTAINER...]

Restart one or more containers

Options:
      --help       Print usage
  -t, --time int   Seconds to wait for stop before killing the container (default 10)

So, in order to restart a running container from a checkpoint, it's necessary to first stop the container...

docker stop <name>

... and then start it from the checkpoint:

docker start --checkpoint <checkpoint>

My suggestion is to add support for --checkpoint and --checkpoint-dir to restart; or, more precisely, to the daemon's ContainerRestart function, which basically just stops and then starts the container, and add it to the API, the client, and the CLI accordingly.

My use case is an experimental test environment which restarts from a checkpoint many many times (to establish a consistent starting state for every single test). Restarting with a single API call instead of two will shave off a few ms per test, which adds up over hundreds or thousands of tests.

@MaxHorstmann
Copy link
Author

I have the code change for this ready and will submit a PR shortly. Any feedback welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/checkpoint Related to (experimental) checkpoint/restore (CRIU)
Projects
None yet
Development

No branches or pull requests

2 participants