diff options
author | shin- <joffrey@dotcloud.com> | 2013-10-14 16:39:52 +0200 |
---|---|---|
committer | shin- <joffrey@dotcloud.com> | 2013-10-14 16:39:52 +0200 |
commit | 07d791d50c7105caf76b4e8090a26870c5b683ea (patch) | |
tree | ac3040de8f2685a2cbaaf63a702e794700b84905 | |
parent | cf46c4d2d91e4dac99f95e5802364218ce0d040a (diff) | |
download | docker-py-07d791d50c7105caf76b4e8090a26870c5b683ea.tar.gz |
Moved docstrings into README.md for consistency.
-rw-r--r-- | README.md | 7 | ||||
-rw-r--r-- | docker/client.py | 20 |
2 files changed, 4 insertions, 23 deletions
@@ -27,7 +27,8 @@ Identical to the `docker cp` command. * `c.create_container(image, command, hostname=None, user=None, detach=False, stdin_open=False, tty=False, mem_limit=0, ports=None, environment=None, dns=None, volumes=None, volumes_from=None, privileged=False)` Creates a container that can then be `start`ed. Parameters are similar to those for the `docker run` command except it doesn't support the attach options -(`-a`) +(`-a`) +In order to create volumes that can be rebinded at start time, use the following syntax: `volumes={"/srv": "" }` * `c.diff(container)` Identical to the `docker diff` command. @@ -96,8 +97,8 @@ Similar to the `docker start` command, but doesn't support attach options. Use `docker logs` to recover `stdout`/`stderr` `binds` Allows to bind a directory in the host to the container. Similar to the `docker run` command with option `-v="/host:/mnt"`. -Requires the container to be created with the volumes argument: -`c.create_container(..., volumes={'/mnt': {}})` +Note that you must declare "blank" volumes at container creation to use binds. +Example of binds mapping from host to container: `{'/mnt/srv/': '/srv'}` `lxc_conf` allows to pass LXC configuration options in dict form. * `c.stop(container, timeout=10)` diff --git a/docker/client.py b/docker/client.py index 8ee5d2d..1a23f93 100644 --- a/docker/client.py +++ b/docker/client.py @@ -231,14 +231,7 @@ class Client(requests.Session): detach=False, stdin_open=False, tty=False, mem_limit=0, ports=None, environment=None, dns=None, volumes=None, volumes_from=None, privileged=False): - ''' - NOTES: - - To create modifiable volumes at start time, use:: - - volumes={"/srv": "" } - - ''' config = self._container_config(image, command, hostname, user, detach, stdin_open, tty, mem_limit, ports, environment, dns, @@ -287,9 +280,6 @@ class Client(requests.Session): return res def import_image(self, src, data=None, repository=None, tag=None): - ''' - To import from a local tarball, use the absolute path to the file - ''' u = self._url("/images/create") params = { 'repo': repository, @@ -444,16 +434,6 @@ class Client(requests.Session): params={'term': term}), True) def start(self, container, binds=None, lxc_conf=None): - ''' - - NOTES: - - Remember that you must declare "blank" volumes - at container creation to use binds - - An example of binds mapping from host to container:: - - {'/mnt/srv/': '/srv'} - - ''' if isinstance(container, dict): container = container.get('Id') start_config = { |