我的项目部署在docker上,linux关闭之后,项目要重启,在此做一个记录

1、启动linux之后,执行docker images或者docker ps,如果出现下面的错误

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

2、则需要启动docker服务,执行:service docker start,如果没有报错,忽略这一步

3、执行docker ps -a,查看需要启动的服务(如果执行docker ps的话,有一些服务是看不到的)

4、通过id重启相应的docker服务

此时便可以访问服务

启动服务的时候报了这个错

[root@localhost ~]# docker start 722cb567ad8b
Error response from daemon: driver failed programming external connectivity on endpoint mall-user-service (f83187d7e06975dbfb8d83d45a6907bf8e575be0aedee8aed9ea694cc90e5b97):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 8184 -j DNAT --to-destination 172.18.6.2:8184 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1))
Error: failed to start containers: 722cb567ad8b

这个时候重启docker就行(systemctl docker restart)

附上关闭cent7的防火墙(systemctl stop firewalld)

GitHub 加速计划 / li / linux-dash
13
2
下载
A beautiful web dashboard for Linux
最近提交(Master分支:3 个月前 )
186a802e added ecosystem file for PM2 5 年前
5def40a3 Add host customization support for the NodeJS version 5 年前
Logo

AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。

更多推荐