tensorflow 的docker鏡像很大,pull一次因爲牆常常失敗。其實docker 能夠將鏡像導出再導入。docker
docker images
以下:tcp
REPOSITORY TAG IMAGE ID CREATED SIZE tensorflow/tensorflow latest 1bb38d61d261 4 months ago 1.21GB
docker save -o /home/dyufei/tensorflow.tar tensorflow/tensorflow 或者 docker save tensorflow/tensorflow > /home/dyufei/tensorflow.tar
docker load -i tensorflow.tar
與上面相似的還有一組導入/導出命令:export/import.與 不一樣的是code
A :export/import 是根據容器來導出鏡像(所以沒有鏡像的歷史記錄)而 save/load 操做的對象是鏡像 B :export/import 鏡像的歷史記錄再導後沒法進行回滾操做,而save/load鏡像有完整的歷史記錄能夠回滾
docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES addc058f62de tensorflow/tensorflow:latest "tensorboard --log..." About an hour ago Up About an hour 0.0.0.0:6006->6006/tcp, 8888/tcp tensorboard
docker export tensorboard > /home/dyufei/tensorflow_tensorboard.tar 或者 docker export -o /home/dyufei/tensorflow_tensorboard.tar tensorboard
sudo docker import - /home/dyufei/tensorflow_tensorboard.tar