The daemon already pings the registry, so doing it on our end is
redundant and error-prone.
The `insecure_registry` argument to `push()`, `pull()` and `login()` has
been deprecated - in the latter case, it wasn't being used anyway.
The `insecure` argument to `docker.auth.resolve_repository_name()` has
also been deprecated.
`docker.utils.ping_registry()` has been deprecated.
`docker.auth.expand_registry_url()` has been removed.
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Treat output from TTY-enabled containers as raw streams, rather than
as multiplexed streams. The docker API docs specify that tty-enabled
containers don't multiplex. Also update tests to pass with these
changes, and changed the code used to read raw streams to not
read line-by-line, and to not skip empty lines.
Addresses issue #630
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
- Add appropriate test which also asserts that volume names can be passed through to drivers.
- Add new param to docs.
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Volume binds now take a "mode" key, whose value can be any string.
"ro" is still supported. It is an error to specify both "ro" and "mode".
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
- Add since, until and filters parameters to `Client.events`
- Add missing `events`command in the documentation
Signed-off-by: Christophe Labouisse <christophe@labouisse.org>
Avoid crashing when the Docker python client is able to load
registry credentials when building using a remote source
Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
The new docker api allows specifing mac address for containers. This change is to allow docker py the same functionality.
Signed-off-by: James Harris <james@rancher.com>
Rather than have one function that can do 5 things and attempts to guess
what the user wanted, it's good to have a function for each possible
method of importing an image. Error cases are handled a lot better this
way.
The unit test test_import_image_from_file() was changed to be
test_import_image_from_bytes(), because if we try to import a temporary
file in the test, the 'data' parameter of the 'fake_request' object is
an instance of a funny internal type like <_io.BufferedReader
name='/tmp/tmpc9chux'> and it's very hard to match such a thing with
`mock.assert_called_with()`.
This allows streaming a system to the 'import' command, rather than
having to read the whole thing into memory before sending it.
Previously both the UnixAdapter and the docker.Client objects would
track the 'base URL' of the Docker daemon (socket path in the case of
local Unix-domain socket connections). The Client object would construct
URLs which contained the path to the socket with the path of the Docker
API call appended. The UnixHTTPConnection instance would then remove the
known socket path from the URL.
This relied on all calls going through the HTTPConnection.request()
function, where the URL could be rewritten. In the case of 'chunked'
HTTP POST requests this doesn't happen, so such calls would request
a path still including the socket path and would receive a 404 error.
The client now constructs URLs containing just the path of the desired API
endpoint, and expects the Unix socket transport to know the path to the
Docker daemon's socket.