summaryrefslogtreecommitdiff
path: root/docs/api.md
diff options
context:
space:
mode:
authorVlad Fratila <vlad.fratila@gmail.com>2014-11-12 17:02:17 +0200
committerVlad Fratila <vlad.fratila@gmail.com>2014-11-12 17:02:17 +0200
commit773cd0cd57753f5f0dda42ff2b8949124d8bbd45 (patch)
treed50faac6d578df7d75253cf78fc01010278e6cbd /docs/api.md
parent00e3ff9574b12e2321c0f3db55498a3ffa43a713 (diff)
downloaddocker-py-773cd0cd57753f5f0dda42ff2b8949124d8bbd45.tar.gz
add documentation for boot2docker #365
Diffstat (limited to 'docs/api.md')
-rw-r--r--docs/api.md29
1 files changed, 26 insertions, 3 deletions
diff --git a/docs/api.md b/docs/api.md
index 19e7829..a9edb33 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -8,16 +8,39 @@ from docker import Client
c = Client(base_url='unix://var/run/docker.sock')
```
+**Boot2docker**:
+
+For usage with boot2docker, there is a helper function in docker.utils named `kwargs_from_env`, it will pass any environment variables from Boot2docker to the Client.
+
+First run boot2docker in your shell:
+```bash
+$ $(boot2docker shellinit)
+Writing /Users/you/.boot2docker/certs/boot2docker-vm/ca.pem
+Writing /Users/you/.boot2docker/certs/boot2docker-vm/cert.pem
+Writing /Users/you/.boot2docker/certs/boot2docker-vm/key.pem
+export DOCKER_HOST=tcp://192.168.59.103:2376
+export DOCKER_CERT_PATH=/Users/you/.boot2docker/certs/boot2docker-vm
+export DOCKER_TLS_VERIFY=1
+```
+
+and then, in your python script:
+```python
+from docker.client import Client
+from docker.utils import kwargs_from_env
+client = Client(**kwargs_from_env())
+print client.version()
+```
+
**Params**:
* base_url (str): Refers to the protocol+hostname+port where the Docker server
is hosted.
* version (str): The version of the API the client will use
* timeout (int): The HTTP request timeout, in seconds.
-* tls (bool or [TLSConfig](tls.md#TLSConfig)): Equivalent CLI options:
-`docker --tls ...`
+* tls (bool or [TLSConfig](tls.md#TLSConfig)): Equivalent CLI options: `docker --tls ...`
+
+****
-
## attach
The `.logs()` function is a wrapper around this method, which you can use