Merge branch 'vladfr-365-document-boot2docker'

This commit is contained in:
Joffrey F 2014-11-14 01:38:08 +01:00
commit 3c48d2d73d
8 changed files with 103 additions and 80 deletions

View File

@ -14,9 +14,9 @@ c = Client(base_url='unix://var/run/docker.sock')
is hosted. is hosted.
* version (str): The version of the API the client will use * version (str): The version of the API the client will use
* timeout (int): The HTTP request timeout, in seconds. * timeout (int): The HTTP request timeout, in seconds.
* tls (bool or [TLSConfig](tls.md#TLSConfig)): Equivalent CLI options: * tls (bool or [TLSConfig](tls.md#TLSConfig)): Equivalent CLI options: `docker --tls ...`
`docker --tls ...`
****
## attach ## attach

23
docs/boot2docker.md Normal file
View File

@ -0,0 +1,23 @@
# Using with Boot2docker
For usage with boot2docker, there is a helper function in the utils package 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
```
You can then instantiate `docker.Client` like this:
```python
from docker.client import Client
from docker.utils import kwargs_from_env
client = Client(**kwargs_from_env())
print client.version()
```

View File

@ -12,5 +12,4 @@ Our latest stable is always available on PyPi.
Full documentation is available in the `/docs/` directory. Full documentation is available in the `/docs/` directory.
## License ## License
Docker is licensed under the Apache License, Version 2.0. See LICENSE for full Docker is licensed under the Apache License, Version 2.0. See LICENSE for full license text
license text

View File

@ -1,7 +1,7 @@
# Using volumes # Using volumes
Volume declaration is done in two parts. First, you have to provide a list of Volume declaration is done in two parts. First, you have to provide
mountpoints to the `Client().create_container()` method. a list of mountpoints to the `Client().create_container()` method.
```python ```python
c.create_container('busybox', 'ls', volumes=['/mnt/vol1', '/mnt/vol2']) c.create_container('busybox', 'ls', volumes=['/mnt/vol1', '/mnt/vol2'])

View File

@ -11,5 +11,6 @@ pages:
- [volumes.md, Using Volumes] - [volumes.md, Using Volumes]
- [tls.md, Using TLS] - [tls.md, Using TLS]
- [host-devices.md, Host devices] - [host-devices.md, Host devices]
- [boot2docker.md, Using with boot2docker]
- [change_log.md, Change Log] - [change_log.md, Change Log]
- [contributing.md, Contributing] - [contributing.md, Contributing]