Changes

Jump to navigation Jump to search
8 bytes removed ,  18:53, 18 July 2016
m
Line 61: Line 61:  
Beyond the straightforward case of checkpointing and restoring the same container, it's also possible to checkpoint one container, and then restore the checkpoint into a completely different container. Right now that is done with the <code>--force</code> option, in conjunction with the <code>--image-dir</code> option. Here's a slightly revised example from before:
 
Beyond the straightforward case of checkpointing and restoring the same container, it's also possible to checkpoint one container, and then restore the checkpoint into a completely different container. Right now that is done with the <code>--force</code> option, in conjunction with the <code>--image-dir</code> option. Here's a slightly revised example from before:
   −
  $ docker run -d --name looper2 --security-opt seccomp:unconfined busybox /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
+
$ docker run -d --name looper2 --security-opt seccomp:unconfined busybox /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
 
+
  # wait a few seconds to give the container an opportunity to print a few lines, then
+
# wait a few seconds to give the container an opportunity to print a few lines, then
  $ docker checkpoint --image-dir=/tmp/checkpoint1 looper2
+
$ docker checkpoint --image-dir=/tmp/checkpoint1 looper2
 
+
  $ docker create --name looper-force --security-opt seccomp:unconfined busybox /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
+
$ docker create --name looper-force --security-opt seccomp:unconfined busybox /bin/sh -c 'i=0; while true; do echo $i; i=$(expr $i + 1); sleep 1; done'
 
+
  $ docker restore --force=true --image-dir=/tmp/checkpoint1 looper-force
+
$ docker restore --force=true --image-dir=/tmp/checkpoint1 looper-force
     
21

edits

Navigation menu