mirror of
https://github.com/containers/podman.git
synced 2025-08-06 03:19:52 +08:00
Added option to keep containers running after checkpointing
CRIU supports to leave processes running after checkpointing: -R|--leave-running leave tasks in running state after checkpoint runc also support to leave containers running after checkpointing: --leave-running leave the process running after checkpointing With this commit the support to leave a container running after checkpointing is brought to Podman: --leave-running, -R leave the container running after writing checkpoint to disk Now it is possible to checkpoint a container at some point in time without stopping the container. This can be used to rollback the container to an early state: $ podman run --tmpfs /tmp --name podman-criu-test -d docker://docker.io/yovfiatbeb/podman-criu-test $ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample 3 $ podman container checkpoint -R -l $ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample 4 $ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample 5 $ podman stop -l $ podman container restore -l $ curl 10.88.64.253:8080/examples/servlets/servlet/HelloWorldExample 4 So after checkpointing the container kept running and was stopped after some time. Restoring this container will restore the state right at the checkpoint. Signed-off-by: Adrian Reber <areber@redhat.com>
This commit is contained in:

committed by
Adrian Reber

parent
ff47a4c2d5
commit
b0572d6229
@ -833,7 +833,8 @@ func (c *Container) Refresh(ctx context.Context) error {
|
||||
// ContainerCheckpointOptions is a struct used to pass the parameters
|
||||
// for checkpointing to corresponding functions
|
||||
type ContainerCheckpointOptions struct {
|
||||
Keep bool
|
||||
Keep bool
|
||||
KeepRunning bool
|
||||
}
|
||||
|
||||
// Checkpoint checkpoints a container
|
||||
|
Reference in New Issue
Block a user