readme: fix example for checkpoint
Signed-off-by: Ace-Tang <aceapril@126.com>
This commit is contained in:
parent
6b25c1e45c
commit
f014adfa17
@ -172,11 +172,9 @@ checkpoint, err := task.Checkpoint(context)
|
|||||||
err := client.Push(context, "myregistry/checkpoints/redis:master", checkpoint)
|
err := client.Push(context, "myregistry/checkpoints/redis:master", checkpoint)
|
||||||
|
|
||||||
// on a new machine pull the checkpoint and restore the redis container
|
// on a new machine pull the checkpoint and restore the redis container
|
||||||
image, err := client.Pull(context, "myregistry/checkpoints/redis:master")
|
checkpoint, err := client.Pull(context, "myregistry/checkpoints/redis:master")
|
||||||
|
|
||||||
checkpoint := image.Target()
|
redis, err = client.NewContainer(context, "redis-master", containerd.WithNewSnapshot("redis-rootfs", checkpoint))
|
||||||
|
|
||||||
redis, err = client.NewContainer(context, "redis-master", containerd.WithCheckpoint(checkpoint, "redis-rootfs"))
|
|
||||||
defer container.Delete(context)
|
defer container.Delete(context)
|
||||||
|
|
||||||
task, err = redis.NewTask(context, cio.Stdio, containerd.WithTaskCheckpoint(checkpoint))
|
task, err = redis.NewTask(context, cio.Stdio, containerd.WithTaskCheckpoint(checkpoint))
|
||||||
|
Loading…
Reference in New Issue
Block a user