summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorStephen Newey <github@s-n.me>2015-08-12 18:12:56 +0100
committerStephen Newey <github@s-n.me>2015-08-12 18:12:56 +0100
commit1c1d7eee5a7a583635892a2ba753a67c82a80325 (patch)
tree130220c40987db2fd1a849a796e72df3830a67d9 /docs
parent2febf104a02e5d7c17ba321cf179848f4c9a7945 (diff)
parentc697f0c26c0c06dd4626f4cc77c3a5e0e70494ee (diff)
downloaddocker-py-1c1d7eee5a7a583635892a2ba753a67c82a80325.tar.gz
Merge branch 'master' into exec_create_user
Diffstat (limited to 'docs')
-rw-r--r--docs/api.md61
-rw-r--r--docs/change_log.md71
-rw-r--r--docs/hostconfig.md2
3 files changed, 122 insertions, 12 deletions
diff --git a/docs/api.md b/docs/api.md
index 9f580a0..b890b96 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -30,7 +30,7 @@ the entire backlog.
* container (str): The container to attach to
* stdout (bool): Get STDOUT
* stderr (bool): Get STDERR
-* stream (bool): Return an interator
+* stream (bool): Return an iterator
* logs (bool): Get all previous output
**Returns** (generator or str): The logs or output for the image
@@ -70,7 +70,7 @@ correct value (e.g `gzip`).
- memory (int): set memory limit for build
- memswap (int): Total memory (memory + swap), -1 to disable swap
- cpushares (int): CPU shares (relative weight)
- - cpusetcpus (str): CPUs in which to allow exection, e.g., `"0-3"`, `"0,1"`
+ - cpusetcpus (str): CPUs in which to allow execution, e.g., `"0-3"`, `"0,1"`
* decode (bool): If set to `True`, the returned stream will be decoded into
dicts on the fly. Default `False`.
@@ -123,7 +123,7 @@ Identical to the `docker commit` command.
* tag (str): The tag to push
* message (str): A commit message
* author (str): The name of the author
-* conf (dict): The configuraton for the container. See the [Docker remote api](
+* conf (dict): The configuration for the container. See the [Docker remote api](
https://docs.docker.com/reference/api/docker_remote_api/) for full details.
## containers
@@ -184,7 +184,7 @@ information on how to create port bindings and volume mappings.
The `mem_limit` variable accepts float values (which represent the memory limit
of the created container in bytes) or a string with a units identification char
-('100000b', 1000k', 128m', '1g'). If a string is specified without a units
+('100000b', '1000k', '128m', '1g'). If a string is specified without a units
character, bytes are assumed as an intended unit.
`volumes_from` and `dns` arguments raise [TypeError](
@@ -234,6 +234,27 @@ from. Optionally a single string joining container id's with commas
'Warnings': None}
```
+### parse_env_file
+
+A utility for parsing an environment file.
+
+The expected format of the file is as follows:
+
+```
+USERNAME=jdoe
+PASSWORD=secret
+```
+
+The utility can be used as follows:
+
+```python
+>> import docker.utils
+>> my_envs = docker.utils.parse_env_file('/path/to/file')
+>> docker.utils.create_container_config('1.18', '_mongodb', 'foobar', environment=my_envs)
+```
+
+You can now use this with 'environment' for `create_container`.
+
## diff
Inspect changes on a container's filesystem
@@ -251,8 +272,8 @@ function return a blocking generator you can iterate over to retrieve events as
**Params**:
-* since (datetime or int): get events from this point
-* until (datetime or int): get events until this point
+* since (UTC datetime or int): get events from this point
+* until (UTC datetime or int): get events until this point
* filters (dict): filter the events by event time, container or image
* decode (bool): If set to true, stream will be decoded into dicts on the
fly. False by default.
@@ -398,7 +419,7 @@ src will be treated as a URL instead to fetch the image from. You can also pass
an open file handle as 'src', in which case the data will be read from that
file.
-If `src` is unset but `image` is set, the `image` paramater will be taken as
+If `src` is unset but `image` is set, the `image` parameter will be taken as
the name of an existing image to import from.
**Params**:
@@ -512,7 +533,16 @@ Kill a container or send a signal to a container
**Params**:
* container (str): The container to kill
-* signal (str or int): The singal to send. Defaults to `SIGKILL`
+* signal (str or int): The signal to send. Defaults to `SIGKILL`
+
+## load_image
+
+Load an image that was previously saved using `Client.get_image`
+(or `docker save`). Similar to `docker load`.
+
+**Params**:
+
+* data (binary): Image data to be loaded
## login
@@ -718,6 +748,10 @@ Identical to the `docker search` command.
Similar to the `docker start` command, but doesn't support attach options. Use
`.logs()` to recover `stdout`/`stderr`.
+**Params**:
+
+* container (str): The container to start
+
**Deprecation warning:** For API version > 1.15, it is highly recommended to
provide host config options in the
[`host_config` parameter of `create_container`](#create_container)
@@ -740,7 +774,7 @@ This will stream statistics for a specific container.
**Params**:
-* container (str): The container to start
+* container (str): The container to stream statistics for
* decode (bool): If set to true, stream will be decoded into dicts on the
fly. False by default.
@@ -829,10 +863,13 @@ Nearly identical to the `docker version` command.
## wait
Identical to the `docker wait` command. Block until a container stops, then
-print its exit code. Returns the value `-1` if no `StatusCode` is returned by
-the API.
+return its exit code. Returns the value `-1` if the API responds without a
+`StatusCode` attribute.
-If `container` a dict, the `Id` key is used.
+If `container` is a dict, the `Id` key is used.
+
+If the timeout value is exceeded, a `requests.exceptions.ReadTimeout`
+exception will be raised.
**Params**:
diff --git a/docs/change_log.md b/docs/change_log.md
index aac4acb..5e91861 100644
--- a/docs/change_log.md
+++ b/docs/change_log.md
@@ -1,6 +1,77 @@
Change Log
==========
+1.3.1
+-----
+
+[List of PRs / issues for this release](https://github.com/docker/docker-py/issues?q=milestone%3A1.3.1+is%3Aclosed)
+
+### Bugfixes
+
+* Fixed a bug where empty chunks in streams was misinterpreted as EOF.
+* `datetime` arguments passed to `Client.events` parameters `since` and
+ `until` are now always considered to be UTC.
+* Fixed a bug with Docker 1.7.x where the wrong auth headers were being passed
+ in `Client.build`, failing builds that depended on private images.
+* `Client.exec_create` can now retrieve the `Id` key from a dictionary for its
+ container param.
+
+### Miscellaneous
+
+* 404 API status now raises `docker.errors.NotFound`. This exception inherits
+ `APIError` which was used previously.
+* Docs fixes
+* Test fixes
+
+1.3.0
+-----
+
+[List of PRs / issues for this release](https://github.com/docker/docker-py/issues?q=milestone%3A1.3.0+is%3Aclosed)
+
+### Deprecation warning
+
+* As announced in the 1.2.0 release, `Client.execute` has been removed in favor of
+ `Client.exec_create` and `Client.exec_start`.
+
+### Features
+
+* `extra_hosts` parameter in host config can now also be provided as a list.
+* Added support for `memory_limit` and `memswap_limit` in host config to
+ comply with recent deprecations.
+* Added support for `volume_driver` in `Client.create_container`
+* Added support for advanced modes in volume binds (using the `mode` key)
+* Added support for `decode` in `Client.build` (decodes JSON stream on the fly)
+* docker-py will now look for login configuration under the new config path,
+ and fall back to the old `~/.dockercfg` path if not present.
+
+### Bugfixes
+
+* Configuration file lookup now also work on platforms that don't define a
+ `$HOME` environment variable.
+* Fixed an issue where pinging a v2 private registry wasn't working properly,
+ preventing users from pushing and pulling.
+* `pull` parameter in `Client.build` now defaults to `False`. Fixes a bug where
+ the default options would try to force a pull of non-remote images.
+* Fixed a bug where getting logs from tty-enabled containers wasn't working
+ properly with more recent versions of Docker
+* `Client.push` and `Client.pull` will now raise exceptions if the HTTP
+ status indicates an error.
+* Fixed a bug with adapter lookup when using the Unix socket adapter
+ (this affected some weird edge cases, see issue #647 for details)
+* Fixed a bug where providing `timeout=None` to `Client.stop` would result
+ in an exception despite the usecase being valid.
+* Added `git@` to the list of valid prefixes for remote build paths.
+
+### Dependencies
+
+* The websocket-client dependency has been updated to a more recent version.
+ This new version also supports Python 3.x, making `attach_socket` available
+ on those versions as well.
+
+### Documentation
+
+* Various fixes
+
1.2.3
-----
diff --git a/docs/hostconfig.md b/docs/hostconfig.md
index 001be17..c2a4eda 100644
--- a/docs/hostconfig.md
+++ b/docs/hostconfig.md
@@ -91,6 +91,8 @@ for example:
* ulimits (list): A list of dicts or `docker.utils.Ulimit` objects. A list
of ulimits to be set in the container.
* log_config (`docker.utils.LogConfig` or dict): Logging configuration to container
+* mem_limit (str or num): Maximum amount of memory container is allowed to consume. (e.g. `'1g'`)
+* memswap_limit (str or num): Maximum amount of memory + swap a container is allowed to consume.
**Returns** (dict) HostConfig dictionary