2020-10-14 21:19:34 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -eux
|
|
|
|
|
|
|
|
ls -la
|
|
|
|
|
2021-09-06 08:45:11 +00:00
|
|
|
if ! crun checkpoint --help; then
|
|
|
|
echo "crun doesn't support checkpoint/restore"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-05-05 16:10:09 +00:00
|
|
|
echo "Start container"
|
|
|
|
podman --log-level debug run -d quay.io/adrianreber/counter
|
2020-10-14 21:19:34 +00:00
|
|
|
|
|
|
|
echo "See which containers are running"
|
|
|
|
podman ps
|
|
|
|
|
2021-05-05 16:10:09 +00:00
|
|
|
echo "Connect to the container"
|
|
|
|
curl `podman inspect -l | jq -r '.[0].NetworkSettings.IPAddress'`:8088
|
2020-10-14 21:19:34 +00:00
|
|
|
|
|
|
|
echo "Checkpoint container"
|
|
|
|
podman --log-level debug container checkpoint -l
|
|
|
|
|
|
|
|
podman ps -a
|
|
|
|
echo "Restore container"
|
|
|
|
podman --log-level debug container restore -l
|
|
|
|
|
|
|
|
podman ps -a
|
|
|
|
echo "Check if we can connect to the restored container"
|
2021-05-05 16:10:09 +00:00
|
|
|
curl `podman inspect -l | jq -r '.[0].NetworkSettings.IPAddress'`:8088
|
2020-10-14 21:19:34 +00:00
|
|
|
|
|
|
|
ls -la
|