Docker - Start a Container Automatically: Difference between revisions

From NovaOrdis Knowledge Base
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.  


<font color=red>This does not seem to work with docker 1.7.1, I get the old configuration, even if I stop before editing.</font>The container configuration may also be edited directly and the restart policy specified in <tt>/var/lib/docker/containers/<container-id>/hostconfig.json</tt> as:
<font color=red>This does not seem to work with docker 1.7.1, I get the old configuration, even if I stop before editing. The container configuration may also be edited directly: [[Docker_Container_Configuration#RestartPolicy|RestartPolicy]]</font>.
 
<pre>
...
"RestartPolicy":{"Name":"always","MaximumRetryCount":0},
...
</pre>

Revision as of 06:23, 5 December 2017

Internal

Overview

The restart policy can be specified when the container is started with --restart=always flag.

This does not seem to work with docker 1.7.1, I get the old configuration, even if I stop before editing. The container configuration may also be edited directly: RestartPolicy.