Kaydet (Commit) 7479d4cd authored tarafından Shreyas Karnik's avatar Shreyas Karnik

added documentation for restart policy

üst a1168c89
......@@ -232,7 +232,7 @@ Identical to the `docker search` command.
```python
c.start(container, binds=None, port_bindings=None, lxc_conf=None,
publish_all_ports=False, links=None, privileged=False,
dns=None, dns_search=None, volumes_from=None, network_mode=None)
dns=None, dns_search=None, volumes_from=None, network_mode=None, restart_policy=None)
```
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]':
reuses another container network stack), 'host': use the host network stack
inside the container.
`restart_policy` is available since v1.2.0 and sets the RestartPolicy for how a container should or should not be
restarted on exit. By default the policy is set to no meaning do not restart the container when it exits.
The user may specify the restart policy as a dictionary for example:
for example:
```
{
"MaximumRetryCount": 0,
"Name": "always"
}
```
for always restarting the container on exit or can specify to restart the container to restart on failure and can limit
number of restarts.
for example:
```
{
"MaximumRetryCount": 5,
"Name": "on-failure"
}
```
```python
c.stop(container, timeout=10)
```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment