From 07d791d50c7105caf76b4e8090a26870c5b683ea Mon Sep 17 00:00:00 2001 From: shin- Date: Mon, 14 Oct 2013 16:39:52 +0200 Subject: [PATCH] Moved docstrings into README.md for consistency. --- README.md | 7 ++++--- docker/client.py | 20 -------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 39a349b4..270defea 100644 --- a/README.md +++ b/README.md @@ -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 8ee5d2db..1a23f930 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 = {