Commit Graph

194 Commits

Author SHA1 Message Date
Joffrey F 2218dbaa67 Use create_host_config in start (unifying parameter processing) 2014-12-18 18:03:27 -08:00
Joffrey F 53beba75f4 Merge pull request #427 from abanna/adding_multiple_dockercfg_support
adding the ability to login with different dockercfg files.
2014-12-18 10:39:59 -08:00
abanna d3cf874938 missed a lint error 2014-12-18 10:21:02 -08:00
Alex Banna 4cbf4e312c adding the ability to login with different dockercfg files. 2014-12-18 10:19:40 -08:00
Marcus Cobden 17c1869304 Tidy up stream test harness & fix race conditions 2014-12-18 09:23:21 +00:00
Joffrey F 8aded4842b Retry on connection error 2014-12-17 12:55:49 -08:00
Joffrey F b1e0ca0bd6 Merge branch 'master' of https://github.com/leth/docker-py into leth-master
Conflicts:
	tests/test.py
2014-12-17 11:56:58 -08:00
Joffrey F 12aad176b9 Re-added start with hostconfig tests 2014-12-17 11:44:52 -08:00
Joffrey F c29a6a2841 Fixed start_container tests 2014-12-17 11:44:52 -08:00
Joffrey F 19b1379f17 Updated unit tests
* Warnings will now raise exceptions in unit tests
* Updated several tests to use host_config
2014-12-17 11:44:51 -08:00
Joffrey F f2ba7f9b9d Merge pull request #429 from dims/master
Devices should be separated by colon separated string
2014-12-17 11:32:58 -08:00
Davanum Srinivas 3a51d3fe0b Devices should be separated by colon separated string
Totally bad test :( (written by me). The documentation and
code should match now. Many thanks to pranavs18 for spotting
the error and proposing the fix.
2014-12-17 07:35:07 -05:00
Marcus Cobden 578dda64c9 Consume from chunked streams without data loss
Data already in local python buffers was lost when stream socket
fileobject was re-created. We now use http.client to handle the chunk
transfer encoding, and we read only the data from each chunk.

This adds a test harness for stream responses which tries to trigger the
lost-buffer behaviour by responding to the HTTP request in full, as
early as possible.

NB: Python's http.client will close the socket fileobj early if there is
no content length or chunked transfer encoding header. If this happens,
requests/urllib3 will reopen it, but we lose some data which was stored
in buffers.
2014-12-16 20:36:08 +00:00
Derek Hammer d8e8400419 Allow for pull as an option to docker build
Signed-off-by: Derek Hammer <derek.r.hammer@gmail.com>
2014-12-13 10:31:47 -08:00
Joffrey F a9bc84cece Enforce passing string as version param in ctor 2014-11-26 23:14:19 +01:00
Joffrey F c4bb57286a Merge branch 'filters' of github.com:irachex/docker-py into irachex-filters
Conflicts:
	docker/utils/__init__.py
	docker/utils/utils.py
	tests/utils_test.py
2014-11-03 20:07:04 +01:00
Joffrey F 213ca7d71d Merge branch 'feature_logs-tail' of github.com:totem/docker-py into totem-feature_logs-tail
Conflicts:
	docker/client.py
	tests/fake_api.py
2014-10-30 15:07:58 +01:00
Joffrey F 92d1c8e77c Merge pull request #379 from tutumcloud/logs_tail
Added tail behaviour to logs command, same as CLI v1.3 (latest)
2014-10-30 14:57:12 +01:00
Joffrey F 9b63cc548a Merge pull request #324 from infoxchange/clear-unixconn-pool
Clear UNIX connections pool to avoid ResourceWarnings
2014-10-30 13:49:40 +01:00
Joffrey F 37c8072f60 Merge branch 'pause-unpause' of github.com:phensley/docker-py into phensley-pause-unpause
Conflicts:
	README.md
	tests/integration_test.py
	tests/test.py
2014-10-29 19:35:05 +01:00
Joffrey F 75d8ff16e4 Merge branch 'support-devices' of github.com:dims/docker-py into dims-support-devices
Conflicts:
	README.md
2014-10-29 17:23:42 +01:00
Joffrey F e0d6b267ee Merge branch 'exec' of github.com:phensley/docker-py into phensley-exec
Conflicts:
	README.md
2014-10-29 17:19:27 +01:00
Joffrey F ca6fc27740 Merge pull request #306 from groundeffect/master
Add support for 'cpuset'
2014-10-29 17:01:01 +01:00
Alberto 5c06bc7f49 Added tail behaviour to logs command, same as CLI v1.3 (latest) 2014-10-27 18:31:47 +01:00
Davanum Srinivas 7a917cc7a0 Ability to specify Host Devices during container start
The command line and daemon started supporting --device
parameter during docker start a while ago in the following commit:
docker/docker@e855c4b

Since the command line looks like this,
--device=[] Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc)
This patch allows a list of strings to be passed into the start() method
and we parse out the 3 components just like in the above mentioned commit
2014-10-24 11:43:30 -04:00
Søren Gjesse 60edfe84b8 Add directories to the Docker context
This change adds both files and directories to the tra-file for the
Docker context. Previously only files where added.

The context will now also contain empty directoryes and symlinks
to directories.
2014-10-21 14:01:57 +02:00
Patrick Hensley f95c8c4dfc Unit and integration tests for exec. 2014-10-17 16:06:14 -04:00
Huayi Zhang 589e7006d5 Add support for filtering images and containers
[`filters` is a json encoded value of the filters (a map[string][string]) to process on the images list. ][1]
The tricky thing is that we must convert boolean value to string and any filter value to list to make a `map[string][string]` json format

[1]: https://docs.docker.com/reference/api/docker_remote_api_v1.14/#list-images
2014-10-05 23:18:48 +08:00
Patrick Hensley 288e53b28b Unit and integration tests for pause/unpause. 2014-10-04 23:46:33 -04:00
Alexey Kotlyarov aff1fbc506 Test resource warnings when using the client 2014-09-22 16:24:23 +10:00
Christian Hammerl 9523950829 add support to add or drop capabilities 2014-09-04 23:15:47 +02:00
davy 4388157fef Added support for 'cpuset' 2014-08-27 13:38:27 +02:00
Shreyas Karnik c6046ac137 first cut of restart policy 2014-08-26 21:35:04 -05:00
sukrit007 c27a459e61 Add support for tailing logs (introduced in API : v1.13)
Updated default version to v1.13
2014-08-22 16:32:48 -07:00
Joffrey F 9999cb0663 pep8 fix 2014-08-22 17:08:57 +02:00
Cameron Maske 5800c4ab06 Allow pushing a single tag.
Closes #282
2014-08-22 10:14:51 -04:00
Joffrey F dba1c45454 Merge pull request #291 from yograterol/master
Volumes parameter on create_container should be validated as string
2014-08-22 13:12:41 +02:00
Maxime Petazzoni 97366f6b60 Stop timeout should be added to the request timeout
Using the max of the stop timeout and request timeout did not entirely
make sure that a stop timeout greater than a request timeout wouldn't
fail prematurely with a HTTPTimeout exception. The correct behavior is
to add the timeouts together, as the stop timeout is understood to be
part of the "request processing time". Any transport-level timeout thus
comes in addition to that.

Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2014-08-19 10:37:54 -07:00
Yohan Graterol 28e27eb81a Create test for volume as string 2014-08-17 02:42:35 -05:00
Leonid Mirsky 98a4aa994c Adding tests for mem_limit string conversion + adding default unit 2014-08-05 22:02:02 +03:00
Joffrey F e2ac293c1e Merge pull request #280 from emonty/remove_auth_from_tests
Protect push tests from environment
2014-07-23 20:26:02 +02:00
Joffrey F 8e45264907 Merge pull request #268 from brutasse/265-dockerignore
Add support for .dockerignore
2014-07-23 20:25:07 +02:00
Bruno Renié 87b4d327d1 Add support for .dockerignore
Fixes #265.

Implementation is a bit more elaborate than docker's implementation and
matches with the one proposed in dotcloud/docker#6869 to handle permission
issues more nicely.
2014-07-23 15:05:53 +02:00
Monty Taylor 5f2c3de6bb Protect push tests from environment
If the tests are run somewhere that somebody has push auth
configured, the auth headers bleed into the tests. Add a mock
to prevent that from happening.
2014-07-22 10:26:46 -07:00
Joffrey F d33ba883f1 Fixed base_url related tests 2014-07-03 04:16:08 +02:00
Ali Vakilzade ea728c1bd5 get size from Client.containers 2014-06-22 21:10:28 +04:30
d11wtq 1ec551cbe7 Add resize() method to Client 2014-06-21 12:21:44 +00:00
Joffrey F be0afebc98 Update unit tests to use API v1.12 2014-06-20 20:55:49 +02:00
Joffrey F fb11abc8c6 Merge pull request #236 from rail44/feature-support-get-and-load-image
Support get and load image
2014-06-17 02:24:30 +02:00
Satoshi Amemiya 9461035d49 Support get and load image 2014-06-02 16:41:52 +09:00
Sam Riley d34b78aac5 Fix joining of unicode and byte strings in python3.
Check logs response in unit tests, and fix log integration tests for
py3.
2014-06-01 09:01:42 +01:00
Joffrey F c2b259009a Updated unit tests 2014-05-28 02:03:10 +02:00
Joffrey F 97c9de0203 Merge pull request #221 from tutumcloud/memoryswap
memory swap limit support
2014-05-13 21:30:41 +02:00
Bernardo 7497daf34a memory swap limit support 2014-05-11 17:45:15 -04:00
Joffrey F 9bb292bcbd Merge pull request #209 from tarnfeld/feature/build-context
Added ability to specify the full build context
2014-04-28 20:51:46 +02:00
Joffrey F 6c1f7f3e97 Merge pull request #198 from fcoelho/fix-volumes-from
Sanitize create_container input for volumes_from
2014-04-23 19:47:07 +02:00
Tom Arnfeld 8acff57f6a Added test for gzip compressed tar 2014-04-23 13:42:05 +01:00
Tom Arnfeld 45ef4ab931 Fix for pep8 failures 2014-04-23 13:36:36 +01:00
Tom Arnfeld 8983fa561c Added ability to specify the full build context 2014-04-23 13:18:50 +01:00
Ryan Wallner 77fec67c60 fixes #175, fix flake8 erros 2014-04-16 14:40:08 -04:00
Felipe Bessa Coelho 3fa6f231fa Missed empty line for flake8 2014-04-09 13:24:57 -03:00
Felipe Bessa Coelho 16ad8198a9 Add test to check for the absence of volumes_from 2014-04-09 13:10:08 -03:00
shin- a37d0eea16 Added unit test for create_container with volumes_from 2014-04-04 17:11:00 +02:00
Evgeniy L 2a1484f655 Fixes for flake8
Next rules were broken
* E265 block comment should start with '# '
* E713 test for membership should be 'not in'
2014-03-28 23:08:22 +04:00
Maxime Petazzoni 64f4ba90ff Support remote API v1.8 (and make it the default)
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2014-02-05 15:25:49 -08:00
Darren Shepherd 8448d0217b Fix unit tests broken by PR #151
Updates newer unit tests to use the http+unix scheme.
2014-01-27 11:25:32 -07:00
Joffrey F 38f3d08114 Merge pull request #151 from ibuildthecloud/http-unix-scheme
Support requests >=2.1.0
2014-01-27 09:49:20 -08:00
Joffrey F 38a5967bfd Merge pull request #145 from aanand/set-stdinonce
If attaching to stdin, set StdinOnce, as per the docker CLI.
2014-01-27 09:43:28 -08:00
Ben Firshman 22f147569b Allow links to specified as (name, alias) tuples 2014-01-27 15:21:44 +00:00
Darren Shepherd cf946ff27b flake8 fixes
Additionally this change should make moving to /v1.8 slightly less painful
2014-01-26 16:52:14 -07:00
Darren Shepherd 89922efbac Support requests >=2.1.0
Starting with requests 2.1.0 non-HTTP scheme URLs are not parsed anymore.
The net effect of this is that when using the unix socket in docker-py no
query string params are passed in the URL.  This change makes docker-py
internally use the scheme http+unix to indicate to requests that this is
still a HTTP URL and should be parsed.

Users of docker-py can still specify 'unix:' as the base_url.  The
following forms of base_url are accepted.

  http+unix://var/run/docker.sock
  unix://var/run/docker.sock
  unix:///var/run/docker.sock
  http://hostname
  tcp://hostname
2014-01-26 16:28:47 -07:00
Aanand Prasad f2285cb899 If attaching to stdin, set StdinOnce, as per the docker CLI. 2014-01-20 18:00:40 +00:00
Ben Firshman 4bc5d27e51 Add working_dir option to create_container 2014-01-19 16:41:40 +00:00
Ben Firshman ab2f7a5e38 Add cpu_shares option to create_container 2014-01-19 16:41:25 +00:00
Ben Firshman 8e8b355acd Add entrypoint option to create_container 2014-01-19 16:41:08 +00:00
shin- 477831334c Merge branch 'master' of git://github.com/dotcloud/docker-py 2014-01-16 20:26:06 +01:00
shin- 8a5cd6ae65 Merge branch 'feature/image-import' of github.com:tarnfeld/docker-py into tarnfeld-feature/image-import 2014-01-16 20:22:33 +01:00
Joffrey F 4bf75ded43 Merge pull request #119 from ureyes84/master
Updated port function
2014-01-16 11:19:34 -08:00
Maxime Petazzoni dad95ba679 Default to /tcp for port definitions in create_container()
Fixes #141.

Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2014-01-16 10:23:02 -08:00
Maxime Petazzoni 32ad01e110 Rework auth config loading and use of auth data for login/pull/push
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2014-01-07 15:30:50 -08:00
Nada Amin d1427d38be Option to disable network when creating container. 2014-01-03 16:20:45 +00:00
Ulises Reyes d8e0f5a66f Improves code style 2013-12-15 20:42:58 -05:00
Ulises Reyes f5924c3863 Updated the port function in order to parse the new NetworkSettings Port dict (fixes #88) 2013-12-14 22:00:08 -05:00
shin- 5c928dcab5 Fixed start_container_with_port_binds test 2013-12-13 15:47:24 +01:00
shin- 64781888e0 Merge branch 'privilege' of github.com:yukw777/docker-py into yukw777-privilege
Conflicts:
	README.md
	tests/test.py
2013-12-13 15:46:54 +01:00
Maxime Petazzoni 4bc4ee3cf0 Log streaming and correct decoding of multiplexed log streams
Implement log streaming with the stream parameter on logs(), returning a
generator of log lines based on the selected streams (stdout/stderr).
Also correctly decode the multiplexed log streams (current version was
buggy).

Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-12-12 22:26:17 -08:00
shin- 89f2c58918 Improved port binding conversion rules, fixed bugs, added unit tests 2013-12-09 17:45:12 +01:00
Tom Arnfeld 50337f8628 Added failing test for importing an image via name instead of src 2013-12-06 23:00:28 +00:00
Maxime Petazzoni 4c4bd95429 Ensure sorted order on links to make unit test deterministic
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-12-06 15:31:15 +00:00
Maxime Petazzoni 8c4c7c3d49 Ensure sorted order on links to make unit test deterministic
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-11-19 13:37:03 -08:00
Peter Yu e361f4c1cd Privileged option is part of host config, not config 2013-11-18 21:47:33 +00:00
shin- 35d3a3c977 Merge branch 'timeout-support' of github.com:mpetazzoni/docker-py into mpetazzoni-timeout-support
Conflicts:
	docker/client.py
	tests/integration_test.py
	tests/test.py
2013-11-15 21:44:18 +01:00
shin- e694d5af3e Merge branch 'v65-2' of github.com:yukw777/docker-py into yukw777-v65-2
Fixed some tests

Conflicts:
	docker/client.py
	tests/fake_api.py
	tests/integration_test.py
	tests/test.py
2013-11-15 19:53:10 +01:00
shin- 34df4e5343 Fixed auth stuff for Python 3 2013-11-15 18:38:09 +01:00
shin- 2828833607 Merge branch 'master' of github.com:dotcloud/docker-py into yukw777-link
Fixed test_pull and test_pull_stream (don't assume headers content is empty)

Conflicts:
	tests/test.py
2013-11-15 18:21:49 +01:00
Daniel Graña 8561544e30 Add signal argument to kill command 2013-11-14 10:43:57 -02:00
Peter Yu 90d13d5fd2 links implemented. use v1.6 by default now 2013-11-12 16:09:29 +00:00
Maxime Petazzoni cc3c455629 Refactor timeout passing and standardize with keyword parameters
Standardize all HTTP request calls to use keyword parameters for all but
the URL. This makes the refactoring of including the timeout in these
requests' parameters easier and more uniform-looking. Tweaks to the
tests to comply with this new parameter passing scheme, in particular to
the API calls assertions.

Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-11-11 14:02:49 -08:00
shin- 14946ed56b Small test fix 2013-11-11 20:46:50 +01:00
shin- 5b766fc33d Merge branch 'master' of github.com:dotcloud/docker-py 2013-11-11 20:25:41 +01:00