1

Is it possible to rename a docker checkpoint after it has been created? It seems like you should be able to, given that you can rename a container. However, I can't find any information or questions related to it.

I would like to be able to create a checkpoint, without worrying what to call it, and then come back later and give it an appropriate name.

Max
  • 9,220
  • 10
  • 51
  • 83
Bryce
  • 197
  • 1
  • 1
  • 13

1 Answers1

1

Unfortunately, the current Docker Engine API v1.30 (and therefore, by extension, the CLI) does not support renaming a checkpoint.

However, note that a checkpoint is essentially just a collection of files stored in a folder called

/var/lib/docker/containers/<container_id>/checkpoints/<checkpoint_name>

So, if you really need to rename the checkpoint, you can rename the folder:

$ export id=$(docker run -d --name redis redis)
$ docker checkpoint create redis old_checkpoint_name
$ mv /var/lib/docker/containers/$id/checkpoints/old_checkpoint_name /var/lib/docker/containers/$id/checkpoints/new_checkpoint_name
$ docker start --checkpoint new_checkpoint_name redis
Max
  • 9,220
  • 10
  • 51
  • 83
  • I finally got around to testing this! When I rename the checkpoint my docker container doesn't seem to register the change and still shows the old checkpoint when I run $docker checkpoint ls . I've stopped and started it to no avail – Bryce Oct 01 '19 at 19:06