如果很久了,不记得之前docker run 命令


# 安装runlike安装包
pip install runlike
 
# 运行命令
runlike -p <container_name>  # 后面可以是容器名和容器id,-p参数是显示自动换行

然后在升级docker 版本

卸载
rpm -qa | grep docker – – 列出包含docker字段的软件的信息
yum remove docker-1.13.1-96.gitb2f74b2.el7.centos.x86_64 -y
yum remove docker-client-1.13.1-96.gitb2f74b2.el7.centos.x86_64 -y
yum remove docker-common-1.13.1-96.gitb2f74b2.el7.centos.x86_64 -y 

然后安装最新版本docker  略 

systemctl restart docker
systemctl enable docker 

此时运行docker ps -a 发现原来的容器在,但是启动会报错

# docker start `docker ps -a -q`
Error response from daemon: unknown or invalid runtime name: docker-runc
Error response from daemon: unknown or invalid runtime name: docker-runc
Error response from daemon: unknown or invalid runtime name: docker-runc
Error response from daemon: unknown or invalid runtime name: docker-runc
Error: failed to start containers: 40f63de1a018, 51b19a722d78, 1bd3adc940f8, e06a3b307ab4


grep -rl 'docker-runc' /var/lib/docker/containers/ | xargs sed -i 's/docker-runc/runc/g'


然后在systemctl restart docker , 则能看到之前的容器能够启动



 
01-21 15:01