[CRIU] criu with nginx in docker success

Adrian Reber adrian at lisas.de
Fri Jul 3 00:26:17 PDT 2015


I just wanted to let you know, that with additional kernel backports I
was able to checkpoint and restore a simple docker application.

In addition I was also able to checkpoint and restore nginx running in
docker. After applying the patch series from Andrey Vagin

[CRIU] [PATCH 1/5] pipe: don't create a tranport descriptor for inhereted pipes

nginx in docker could be checkpointed and restored:

# /share/docker/bundles/1.8.0-dev/dynbinary/docker run -d -p 80:80 nginx
ffbd5b4c1b34a03e605de390efc9a44d1723aa12b3a5d1ce22981c148e639d04

# curl -I localhost
HTTP/1.1 200 OK   
Server: nginx/1.9.2
Date: Fri, 03 Jul 2015 07:10:34 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Tue, 16 Jun 2015 16:00:26 GMT
Connection: keep-alive
ETag: "5580481a-264"
Accept-Ranges: bytes

# ps aux | grep [n]ginx
root     22033  0.0  0.2  31488  2924 ?        Ss   07:10   0:00 nginx: master process nginx -g daemon off;
104      22042  0.0  0.1  31864  1924 ?        S    07:10   0:00 nginx: worker process

# /share/docker/bundles/1.8.0-dev/dynbinary/docker checkpoint  ffbd5b4c1b34a03e605de390efc9a44d1723aa12b3a5d1ce22981c148e639d04
ffbd5b4c1b34a03e605de390efc9a44d1723aa12b3a5d1ce22981c148e639d04

# ps aux | grep [n]ginx
# /share/docker/bundles/1.8.0-dev/dynbinary/docker restore --work-dir=/tmp/ ffbd5b4c1b34a03e605de390efc9a44d1723aa12b3a5d1ce22981c148e639d04
ffbd5b4c1b34a03e605de390efc9a44d1723aa12b3a5d1ce22981c148e639d04
# ps aux | grep [n]ginx
root     22151  0.0  0.0  31488   804 ?        Ss   07:11   0:00 nginx: master process nginx -g daemon off;
104      22163  0.0  0.1  31864  1220 ?        S    07:11   0:00 nginx: worker process
# curl -I localhost
curl: (56) Recv failure: Connection reset by peer
# /share/docker/bundles/1.8.0-dev/dynbinary/docker ps
CONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS                         NAMES
ffbd5b4c1b34        nginx               "nginx -g 'daemon of   7 minutes ago       Up 6 minutes        0.0.0.0:80->80/tcp, 443/tcp   adoring_bose        

So nginx is still running but the port forwarding is no longer working.
This sounds like something to fix inside of docker. I see a process called
docker-proxy which redirects the port 80 to another IP address then the one
nginx was checkpointed with. So docker needs to know to restore the container
with the same IP it was checkointed with. But this looks really good so far.

		Adrian


More information about the CRIU mailing list