Updated README

This commit is contained in:
Roberto Aguilar 2013-11-04 14:37:44 -08:00
parent 5d6bf51b4f
commit 6047c581df
1 changed files with 13 additions and 2 deletions

View File

@ -30,7 +30,12 @@ Identical to the `docker cp` command.
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`)
In order to create volumes that can be rebinded at start time, use the following syntax: `volumes={"/srv": "" }`
In order to create volumes that can be rebinded at start time, use the
following syntax: `volumes={"/srv": "" }`. The `ports` parameter is a
dictionary whose key is the port to expose and the value is an empty
dictionary: `ports={"2181": {}}`. Note, this will simply expose the ports in
the container, but does not make them available on the host. See `start`
below.
* `c.diff(container)`
Identical to the `docker diff` command.
@ -94,13 +99,19 @@ Restart a container. Similar to the `docker restart` command.
* `c.search(term)`
Identical to the `docker search` command.
* `c.start(container, binds=None, lxc_conf=None)`
* `c.start(container, binds=None, port_bindings=None, lxc_conf=None)`
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"`.
Note that you must declare "blank" volumes at container creation to use binds.
Example of binds mapping from host to container: `{'/mnt/srv/': '/srv'}`
`port_bindings` Exposes container ports to the host. This is a
dictionary whose key is the container's port and the value is a `[{'HostIp': ''
'HostPort': ''}]` list. Leaving `HostIp` blank will expose the port on
all host interfaces. By leaving the `HostPort` blank, Docker will
automatically assign a port. For example: `port_bindings={"2181": [{'HostIp': ''
'HostPort': ''}]}`.
`lxc_conf` allows to pass LXC configuration options in dict form.
* `c.stop(container, timeout=10)`