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

前端 未结 6 1762
滥情空心
滥情空心 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:43

    For people want to auto restart a docker container, but didn't specify --restart flag (default to 'no') while running it, you can use docker update command to add one of the following three other options:

    • on-failure
    • unless-stopped
    • always

    See this post for the details. People have problem with always restart flag on, can consider using either on-failure or unless-stoppedoption.

提交回复
热议问题