sudo docker commit 9ab6e234c9ba linc-wiki
sudo docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE linc-wiki latest b5a1e34b01c2 14 seconds ago 689.7 MB
sudo docker export 9ab6e234c9ba > /home/linc/docker/images-bk/linc-wiki-export.tar
sudo docker save linc-wiki > ../images-bk/linc-wiki-save.tar
$ du -sh *
495M linc-wiki-export.tar
672M linc-wiki-save.tar
sudo cat /home/linc/docker/images-bk/linc-wiki-export.tar | sudo docker import - docker_hgweb
sudo docker load --input ../images-bk/linc-wiki-save.tar
附录:
1.fig使用报错及解决
fig running error:
$ fig up
Couldn't connect to Docker daemon at http:/ - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
fix it:
1) Change the DOCKER_OPTS in /etc/default/docker to:
DOCKER_OPTS="-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock"
2) Restart docker
sudo restart docker
3) Make sure that docker is running on localhost:4243
$ netstat -ant |grep 4243
tcp 0 0 127.0.0.1:4243 0.0.0.0:* LISTEN
4) Set DOCKER_HOST (.bashrc)
export DOCKER_HOST=tcp://localhost:4243
$ echo $DOCKER_HOST
tcp://localhost:4243