1.docker 开机自启设置
[root@localhost ~]# systemctl enable docker.service Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service
2.查看docker是否开机自启
[root@localhost ~]# systemctl list-unit-files | grep docker docker.service enabled
3.设置容器开机自启动
docker update --restart=always "容器名称" [root@localhost ~]# docker update --restart=always mq mq [root@localhost ~]# docker update --restart=always mysql mysql
4.取消容器自启动
docker update --restart=no "容器名称"
————————————————
本文转载自原文链接:https://blog.csdn.net/weixin_44757894/article/details/124931555
文章评论