docker容器开机启动

mac2022-06-30  72

docker容器开机启动

要让docker 的容器自动在开机启动,是写脚本,比如在 rc.local 中写。

其实完全没必要这么麻烦,docker 有相关指令,docker run 指令中加入 --restart=always 就行。

Bash代码 收藏代码

sudo docker run --restart=always .....

如果创建时未指定 --restart=always ,可通过update 命令设置

Bash代码 收藏代码

docker update --restart=always xxx posted on 2018-03-12 16:20  skywalle 阅读( ...) 评论( ...) 编辑 收藏

转载于:https://www.cnblogs.com/skywalle/p/8549930.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)