Docker - Start a Container Automatically: Difference between revisions
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
The [[Docker_Concepts#Restart_Policy|restart policy]] can be specified when the container is started with <tt>[[Docker_run#--restart|--restart=always]]</tt> flag. | The [[Docker_Concepts#Restart_Policy|restart policy]] can be specified when the container is started with <tt>[[Docker_run#--restart|--restart=always]]</tt> flag. | ||
The container configuration can also be edited | The container configuration can also be edited directly. The restart policy is specified in <tt>/var/lib/docker/containers/<container-id>/hostconfig.json</tt>: | ||
<pre> | |||
... | |||
"RestartPolicy":{"Name":"always","MaximumRetryCount":0}, | |||
... | |||
</pre> |
Revision as of 17:54, 19 April 2017
Internal
Overview
The restart policy can be specified when the container is started with --restart=always flag.
The container configuration can also be edited directly. The restart policy is specified in /var/lib/docker/containers/<container-id>/hostconfig.json:
... "RestartPolicy":{"Name":"always","MaximumRetryCount":0}, ...