mirror of https://github.com/docker/docker-py.git
Updated README
This commit is contained in:
parent
5d6bf51b4f
commit
6047c581df
15
README.md
15
README.md
|
|
@ -30,7 +30,12 @@ Identical to the `docker cp` command.
|
||||||
Creates a container that can then be `start`ed. Parameters are similar to those
|
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
|
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": "" }`
|
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)`
|
* `c.diff(container)`
|
||||||
Identical to the `docker diff` command.
|
Identical to the `docker diff` command.
|
||||||
|
|
@ -94,13 +99,19 @@ Restart a container. Similar to the `docker restart` command.
|
||||||
* `c.search(term)`
|
* `c.search(term)`
|
||||||
Identical to the `docker search` command.
|
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.
|
Similar to the `docker start` command, but doesn't support attach options.
|
||||||
Use `docker logs` to recover `stdout`/`stderr`
|
Use `docker logs` to recover `stdout`/`stderr`
|
||||||
`binds` Allows to bind a directory in the host to the container.
|
`binds` Allows to bind a directory in the host to the container.
|
||||||
Similar to the `docker run` command with option `-v="/host:/mnt"`.
|
Similar to the `docker run` command with option `-v="/host:/mnt"`.
|
||||||
Note that you must declare "blank" volumes at container creation to use binds.
|
Note that you must declare "blank" volumes at container creation to use binds.
|
||||||
Example of binds mapping from host to container: `{'/mnt/srv/': '/srv'}`
|
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.
|
`lxc_conf` allows to pass LXC configuration options in dict form.
|
||||||
|
|
||||||
* `c.stop(container, timeout=10)`
|
* `c.stop(container, timeout=10)`
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue