Docker - Start a Container Automatically: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
=Internal=
=Internal=


* [[Docker Client Operations#Recipes|Client Operations]]
* [[Docker_Client_Operations#Container_Lifecycle_Operations|Container Liffecycle Operations]]
* [[Docker_Container_Configuration#RestartPolicy|RestartPolicy]]


=Overview=
=Overview=


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. Also see: {{Internal|Docker_Container_Configuration#RestartPolicy|RestartPolicy}}
 
<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:
 
<pre>
...
"RestartPolicy":{"Name":"always","MaximumRetryCount":0},
...
</pre>

Latest revision as of 02:59, 22 May 2018

Internal

Overview

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

RestartPolicy