网上有些文章说,要让docker 的容器自动在开机启动,是写脚本,比如在 rc.local 中写。
其实完全没必要这么麻烦,docker 有相关指令,docker run 指令中加入 --restart=always 就行。

Bash代码 收藏代码
sudo docker run --restart=always .....

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

Bash代码 收藏代码
docker update --restart=always xxx

相关文章:

  • 2022-12-23
  • 2021-03-31
  • 2021-09-18
猜你喜欢
  • 2022-12-23
  • 2021-08-22
  • 2022-01-12
  • 2021-06-30
相关资源
相似解决方案