How to auto restart a Docker container after a reboot in CoreOS?

前端 未结 6 1684
滥情空心
滥情空心 2021-01-30 21:20

Assuming the Docker daemon is restarted automatically by whatever init.d or systemd like process when the OS is restarted, what is the preferred way to restart one or more Docke

6条回答
  •  再見小時候
    2021-01-30 21:26

    Used Restart and RestartSec to make it work:

    # Restart after crash
    Restart=on-failure
    # Give the service 10 seconds to recover after the previous restart
    RestartSec=10s
    

    View the documentation.

提交回复
热议问题