summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorShreyas Karnik <karnik.shreyas@gmail.com>2014-08-28 12:33:28 -0500
committerShreyas Karnik <karnik.shreyas@gmail.com>2014-08-28 12:33:28 -0500
commit7479d4cd29294e49d121d2dd7be913bb8dfe6d4c (patch)
tree4dd5b2733725c71f96bb860c445a20f423eea4dd /README.md
parenta1168c894aa1395601129ea1b2a2dfff8176d3d7 (diff)
downloaddocker-py-7479d4cd29294e49d121d2dd7be913bb8dfe6d4c.tar.gz
added documentation for restart policy
Diffstat (limited to 'README.md')
-rw-r--r--README.md23
1 files changed, 22 insertions, 1 deletions
diff --git a/README.md b/README.md
index 442123b..39be61d 100644
--- a/README.md
+++ b/README.md
@@ -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)
```