重启docker service时为什么一般情况下不影响已经运行的容器?

8 篇文章 0 订阅

如果是所示,这是docker自身的一个属性决定,该属性默认使true,因此当我们执行systemctl docker restart时已经运行的容器未受影响。

原文在: https://docs.docker.com/config/containers/live-restore/

中文大意‘:/etc/docker/daemon.json配置文件中设置了

{
  "live-restore": true
}

在升级小版本或者重启时,只要不改变daemon-level级别参数,是不会影响已运行容器的

Live restore during upgrades

Live restore allows you to keep containers running across Docker daemon updates, but is only supported when installing patch releases (YY.MM.x), not for major (YY.MM) daemon upgrades.

If you skip releases during an upgrade, the daemon may not restore its connection to the containers. If the daemon can’t restore the connection, it cannot manage the running containers and you must stop them manually.
Live restore upon restart

The live restore option only works to restore containers if the daemon options, such as bridge IP addresses and graph driver, did not change. If any of these daemon-level configuration options have changed, the live restore may not work and you may need to manually stop the container
特别注意不是所有情况下重启docker服务都不影响已运行容器,而是当不改变特定参数情况下,才不影响。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值