@@ -232,7 +232,7 @@ Identical to the `docker search` command.
232
232
```python
233
233
c.start(container, binds = None , port_bindings = None , lxc_conf = None ,
234
234
publish_all_ports = False , links = None , privileged = False ,
235
- dns = None , dns_search = None , volumes_from = None , network_mode = None )
235
+ dns = None , dns_search = None , volumes_from = None , network_mode = None , restart_policy = None )
236
236
```
237
237
238
238
Similar to the `docker start` command, but doesn' t support attach
@@ -258,6 +258,27 @@ docker bridge, 'none': no networking for this container, 'container:[name|id]':
258
258
reuses another container network stack), ' host' : use the host network stack
259
259
inside the container.
260
260
261
+ `restart_policy` is available since v1.2.0 and sets the RestartPolicy for how a container should or should not be
262
+ restarted on exit . By default the policy is set to no meaning do not restart the container when it exits.
263
+ The user may specify the restart policy as a dictionary for example:
264
+ for example:
265
+ ```
266
+ {
267
+ " MaximumRetryCount" : 0 ,
268
+ " Name" : " always"
269
+ }
270
+ ```
271
+ for always restarting the container on exit or can specify to restart the container to restart on failure and can limit
272
+ number of restarts.
273
+ for example:
274
+ ```
275
+ {
276
+ " MaximumRetryCount" : 5 ,
277
+ " Name" : " on-failure"
278
+ }
279
+ ```
280
+
281
+
261
282
```python
262
283
c.stop(container, timeout = 10 )
263
284
```
0 commit comments