Changes

Jump to navigation Jump to search
1,311 bytes removed ,  22:21, 31 March 2017
rewording
Line 1: Line 1: −
This HOWTO page describes how to checkpoint and restore a Docker container.
+
This article describes the status of CRIU integration with Docker, and how to use it.
 
  −
== Introduction ==
  −
 
  −
Docker wants to manage the full lifecycle of processes running inside one if its containers, which makes it important for CRIU and Docker to work closely together when trying to checkpoint and restore a container. This is being achieved by adding the ability to checkpoint and restore directly into Docker itself, powered under the hood by CRIU. This integration is a work in progress, and its status will be outlined below.  
      
== Docker Experimental ==
 
== Docker Experimental ==
   −
Checkpoint & Restore is now available in the _experimental_ runtime mode for Docker. Simply start your docker daemon with '''--experimental''' to enable the feature.
+
Naturally, Docker wants to manage the full lifecycle of processes running inside its containers, so CRIU should be run by Docker (rather than separately).
 +
This feature is available in the ''experimental'' mode for Docker (since Docker 1.13, so every later version, like Docker 17.03, should work).
   −
=== Dependencies ===
+
To enable experimental features (incl. CRIU), you need to do something like this:
   −
In addition to installing version 1.13 of Docker, you need '''CRIU''' installed on your system, with at least version 2.0. You also need some shared libraries on your system. The most likely things you'll need to install are '''libprotobuf-c''' and '''libnl-3'''. Here's an output of <code>ldd</code> on my system:
+
echo "{\"experimental\": true}" >> /etc/docker/daemon.json
 +
systemctl restart docker
   −
$ ldd `which criu`
+
In addition to having a recent version of Docker, you need '''CRIU''' 2.0 or later installed on your system (see [[Installation]] for more info).
    linux-vdso.so.1 =>  (0x00007ffc09fda000)
  −
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fd28b2c7000)
  −
    libprotobuf-c.so.0 => /usr/lib/x86_64-linux-gnu/libprotobuf-c.so.0 (0x00007fd28b0b7000)
  −
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd28aeb2000)
  −
    libnl-3.so.200 => /lib/x86_64-linux-gnu/libnl-3.so.200 (0x00007fd28ac98000)
  −
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd28a8d3000)
  −
    /lib64/ld-linux-x86-64.so.2 (0x000056386bb38000)
  −
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd28a5cc000)
      
=== checkpoint ===  
 
=== checkpoint ===  
Line 70: Line 60:  
You should be able to print the logs from <code>looper-clone</code> and see that they start from wherever the logs of <code>looper</code> end.
 
You should be able to print the logs from <code>looper-clone</code> and see that they start from wherever the logs of <code>looper</code> end.
   −
=== usage ===
+
=== Synopsis ===
    
Checkpoint
 
Checkpoint
Line 98: Line 88:  
       --help                    Print usage
 
       --help                    Print usage
 
   -i, --interactive            Attach container's STDIN
 
   -i, --interactive            Attach container's STDIN
  −
== Integration Status ==
  −
  −
CRIU has already been integrated into the lower level components that power Docker, namely '''runc''' and '''containerd'''. The final step in the process is to integrate with Docker itself. You can track the status of that process in [https://github.com/docker/docker/pull/22049 this pull request].
      
== Compatibility Notes ==
 
== Compatibility Notes ==
Line 153: Line 139:  
* {{torvalds.git|e4a0d3e720}} by Pavel Emelyanov
 
* {{torvalds.git|e4a0d3e720}} by Pavel Emelyanov
   −
== External Checkpoint Restore ==
+
== External checkpoint/restore ==
 
  −
{{Note| External C/R was done as proof-of-concept.  Its use is highly discouraged.}}
     −
Although it's not recommended, you can also learn more about using CRIU without integrating with docker: [[Docker_External]].
+
Although it's not recommended, you can also learn more about using CRIU without integrating with Docker. See [[Docker External]] for more info.

Navigation menu