0

At the moment of writing, docker checkpoint feature is still in experimental phase so there is no official (HTTP) API documentation. Nonetheless, there is an endpoint on the docker daemon that can accept an HTTP request, as it is the one that docker cli uses.

Based on the related docker source code it should be something like

sudo curl -X POST --unix-socket /var/run/docker.sock http://localhost/v1.32/containers/20fb4f16ff10/checkpoints

but this does not work. Any ideas what I may be missing?

Danilo Radenovic
  • 1,019
  • 1
  • 11
  • 23
  • 1
    An easy way to answer this sort of question is to stick a debugging proxy between the docker client and the unix socket, and see exactly what request the client makes when you run `docker checkpoint ...`. I often use `socat` for this purpose. – larsks Oct 02 '17 at 23:27
  • Totally forgot about the socat! Thanks a lot for the hint. – Danilo Radenovic Oct 03 '17 at 10:04

1 Answers1

1

The create options is missing.

curl --unix-socket /var/run/docker.sock \
  -H "Content-Type: application/json" \
  -d '{"CheckpointID": "noting"}' \
  -X POST http:/v1.32/containers/20fb4f16ff10/checkpoints
silverfox
  • 5,254
  • 1
  • 21
  • 26