61

reboot 后 Docker服务及容器自动启动设置 - wxb880114的专栏 - CSDN博客

 4 years ago
source link: https://blog.csdn.net/wxb880114/article/details/82904765
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

reboot 后 Docker服务及容器自动启动设置

original.png
置顶 giserinchina 2018-09-30 08:48:21 articleReadEyes.png 34057
分类专栏: Docker入门到精通
¥9.90

重启reboot操作系统后,发现docker 服务未启动,容器也未启动,天生反骨,怎么才能重启后自动启动呢

解决问题两个问题:

1、docker服务自动重启设置

systemctl enable docker.service

70

2、docker容器自动启动设置

docker ps -a
70

使用一下命令对镜像从起: docker restart imageid

70

在运行docker容器时可以加如下参数来保证每次docker服务重启后容器也自动重启:

docker run --restart=always

如果已经启动了则可以使用如下命令:

docker update --restart=always <CONTAINER ID>
70

重启系统后

docker  ps -a 

70

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK