spiegel_podman/cmd/podman
Adrian Reber f7c8fd8a3d
Add support to checkpoint/restore containers
runc uses CRIU to support checkpoint and restore of containers. This
brings an initial checkpoint/restore implementation to podman.

None of the additional runc flags are yet supported and container
migration optimization (pre-copy/post-copy) is also left for the future.

The current status is that it is possible to checkpoint and restore a
container. I am testing on RHEL-7.x and as the combination of RHEL-7 and
CRIU has seccomp troubles I have to create the container without
seccomp.

With the following steps I am able to checkpoint and restore a
container:

 # podman run --security-opt="seccomp=unconfined" -d registry.fedoraproject.org/f27/httpd
 # curl -I 10.22.0.78:8080
 HTTP/1.1 403 Forbidden # <-- this is actually a good answer
 # podman container checkpoint <container>
 # curl -I 10.22.0.78:8080
 curl: (7) Failed connect to 10.22.0.78:8080; No route to host
 # podman container restore <container>
 # curl -I 10.22.0.78:8080
 HTTP/1.1 403 Forbidden

I am using CRIU, runc and conmon from git. All required changes for
checkpoint/restore support in podman have been merged in the
corresponding projects.

To have the same IP address in the restored container as before
checkpointing, CNI is told which IP address to use.

If the saved network configuration cannot be found during restore, the
container is restored with a new IP address.

For CRIU to restore established TCP connections the IP address of the
network namespace used for restore needs to be the same. For TCP
connections in the listening state the IP address can change.

During restore only one network interface with one IP address is handled
correctly. Support to restore containers with more advanced network
configuration will be implemented later.

v2:
 * comment typo
 * print debug messages during cleanup of restore files
 * use createContainer() instead of createOCIContainer()
 * introduce helper CheckpointPath()
 * do not try to restore a container that is paused
 * use existing helper functions for cleanup
 * restructure code flow for better readability
 * do not try to restore if checkpoint/inventory.img is missing
 * git add checkpoint.go restore.go

v3:
 * move checkpoint/restore under 'podman container'

v4:
 * incorporated changes from latest reviews

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-10-03 21:41:39 +02:00
..
docker Rename all references to kpod to podman 2017-12-18 16:46:05 +00:00
formats switch projectatomic to containers 2018-08-16 17:12:36 +00:00
libpodruntime Hooks supports two directories, process default and override 2018-09-17 16:28:28 +00:00
shared Add container runlabel command 2018-09-28 14:14:13 -05:00
varlink * Update documenation 2018-10-01 07:24:50 -07:00
attach.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
build.go Vendor in latest containers/buildah 2018-09-18 17:20:30 -04:00
checkpoint.go Add support to checkpoint/restore containers 2018-10-03 21:41:39 +02:00
cleanup.go Add ContainerStateExited and OCI delete() in cleanup() 2018-10-02 12:05:22 -04:00
commit.go Vendor in latest containers/buildah 2018-09-18 17:20:30 -04:00
common.go Add --mount option for create & run command 2018-09-21 21:33:41 +00:00
common_test.go Rename all references to kpod to podman 2017-12-18 16:46:05 +00:00
container.go Add support to checkpoint/restore containers 2018-10-03 21:41:39 +02:00
create.go Disable SELinux labeling if --privileged 2018-10-02 03:44:46 -04:00
create_cli.go Add --mount option for create & run command 2018-09-21 21:33:41 +00:00
create_cli_test.go Implement and test the following flags for podman run and create 2018-01-15 19:27:10 +00:00
diff.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
exec.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
export.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
history.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
image.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
images.go Fix displaying size on size calculation error 2018-09-07 21:31:32 +00:00
import.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
info.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
inspect.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
kill.go Add --all flag to podman kill 2018-09-30 07:48:41 +02:00
load.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
login.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
logout.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
logs.go Add CRI logs parsing to podman logs 2018-09-05 13:48:20 +00:00
main.go rootless: always set XDG_RUNTIME_DIR 2018-10-03 10:41:47 +02:00
mount.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
parse.go Fix pod sharing for utsmode 2018-09-07 18:18:54 +00:00
pause.go rootless: check uid with Geteuid() instead of Getuid() 2018-09-04 14:36:57 +00:00
pod.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_create.go Fix pod sharing for utsmode 2018-09-07 18:18:54 +00:00
pod_inspect.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_kill.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_pause.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_ps.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_restart.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_rm.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_start.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_stats.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_stop.go Add ContainerStateExited and OCI delete() in cleanup() 2018-10-02 12:05:22 -04:00
pod_top.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
pod_unpause.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
port.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
ps.go Address review comments and fix ps output 2018-10-02 12:05:22 -04:00
pull.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
push.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
README.md Update Podman-specific readme 2018-05-11 15:32:27 +00:00
refresh.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
restart.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
restore.go Add support to checkpoint/restore containers 2018-10-03 21:41:39 +02:00
rm.go Add podman rm --volumes flag 2018-09-13 13:27:09 +00:00
rmi.go rmi remove all not error when no images are present 2018-09-05 11:06:59 +00:00
run.go Add ContainerStateExited and OCI delete() in cleanup() 2018-10-02 12:05:22 -04:00
run_test.go run/create: reserve -h flag for hostname 2018-08-30 15:45:13 +00:00
runlabel.go Add container runlabel command 2018-09-28 14:14:13 -05:00
save.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
search.go Search registries with an empty query 2018-09-13 16:20:40 +00:00
sigproxy.go switch projectatomic to containers 2018-08-16 17:12:36 +00:00
start.go Add ContainerStateExited and OCI delete() in cleanup() 2018-10-02 12:05:22 -04:00
stats.go rootless: check uid with Geteuid() instead of Getuid() 2018-09-04 14:36:57 +00:00
stop.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
tag.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
top.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
umount.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
unpause.go rootless: check uid with Geteuid() instead of Getuid() 2018-09-04 14:36:57 +00:00
utils.go switch projectatomic to containers 2018-08-16 17:12:36 +00:00
varlink.go don't print help message for usage errors 2018-08-31 10:19:11 +00:00
varlink_dummy.go make varlink optional for podman 2018-06-24 10:54:40 +00:00
version.go switch projectatomic to containers 2018-08-16 17:12:36 +00:00
wait.go Refactor Wait() to not require a timeout 2018-09-21 20:07:51 +00:00

podman - Simple debugging tool for pods and images

podman is a daemonless container runtime for managing containers, pods, and container images. It is intended as a counterpart to CRI-O, to provide low-level debugging not available through the CRI interface used by Kubernetes. It can also act as a container runtime independent of CRI-O, creating and managing its own set of containers.

Use cases

  1. Create containers
  2. Start, stop, signal, attach to, and inspect existing containers
  3. Run new commands in existing containers
  4. Push and pull images
  5. List and inspect existing images
  6. Create new images by committing changes within a container
  7. Create pods
  8. Start, stop, signal, and inspect existing pods
  9. Populate pods with containers