由于缺乏存储空间,我将/var/lib/
移到了外部硬盘data
上,这导致系统崩溃。
重新安装系统后,我想使用之前创建的docker映像,因此首先要进行软链接:
ln -s /data/var/lib/docker/ /var/lib/docker
ln -s /data/var/lib/docker-engine/ /var/lib/docker-engine
var/lib/docker/containers
中的6个文件:
6c60fb4b198ab1400358c56c08d3ec5886ef7266c5e904db259e56bf94cfdc39 b9194213bb77aa8d50e5f794c3b658fb18ca60ad2c6aae9fc2c79c832f4a23e8
856907304c45db8c951d44b9445e4c553d644b1f43c1df10096c7523ea848560 bd001fe7304b8c8558122673acde506874672fa2edd929e7824e3d81fdecf4d6
89b40c05fa839333d0d40927bdc1ab6c7b42496e8130aaded980a4dc02cb33e7 e7048fbb76e3a4857a90773346783d58b66aca74df0e77ededfe100f041b2067
var/lib/docker/image
中的文件:
myname:/var/lib/docker$ cd image/
myname:/var/lib/docker/image$ ls
overlay2
myname:/var/lib/docker/image$ cd overlay2/
myname:/var/lib/docker/image/overlay2$ ls
distribution imagedb layerdb repositories.json
我现在已经重新安装了docker
docker images
显示:
REPOSITORY TAG IMAGE ID CREATED SIZE
wav2letter latest 8f2bc1be8a04 3 months ago 8.94GB
<none> <none> 8f076799dfcf 3 months ago 5.84GB
wav2letter/wav2letter cuda-latest b43dac170ffe 3 months ago 8.94GB
ubuntu 16.04 9361ce633ff1 3 months ago 118MB
nvidia/cuda 9.2-cudnn7-devel-ubuntu16.04 78f3ecf29e62 4 months ago 3.02GB
nvidia/cuda 10.1-base 39556dc8d077 4 months ago 129MB
nvidia/cuda 9.2-base 86d52012c522 4 months ago 106MB
hello-world latest fce289e99eb9 6 months ago 1.84kB
pytorch/pytorch 1.0-cuda10.0-cudnn7-devel fa5b91571a44 7 months ago 5.45GB
和docker ps -a
显示:
zd@user-System-Product-Name:~$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7f6aa3cd0163 hello-world "/hello" 25 minutes ago Exited (0) 25 minutes ago ecstatic_sinoussi
a94e9c44df7e hello-world "/hello" 27 minutes ago Exited (0) 26 minutes ago dreamy_neumann
6c60fb4b198a ubuntu:16.04 "/bin/bash" 3 months ago Exited (127) 3 months ago silly_visvesvaraya
856907304c45 wav2letter/wav2letter:cuda-latest "/bin/bash" 3 months ago Exited (255) 29 minutes ago tmpw2l
e7048fbb76e3 wav2letter/wav2letter:cuda-latest "/bin/bash" 3 months ago Exited (255) 29 minutes ago w2l-cxz
bd001fe7304b wav2letter/wav2letter:cuda-latest "/bin/bash" 3 months ago Exited (255) 29 minutes ago w2l
b9194213bb77 wav2letter:latest "/bin/bash" 3 months ago Exited (255) 29 minutes ago testdocker
89b40c05fa83 wav2letter:latest "/bin/bash" 3 months ago Exited (255) 29 minutes ago myw2l
那么如何从现有的容器和图像中run
?谢谢。