Commit Graph

1016 Commits

Author SHA1 Message Date
Maxime Petazzoni 55b93d676b Merge pull request #210 from aanand/universally-compatible-chunking
Universally-compatible reading of chunked streams
2014-05-21 11:06:23 -07: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
Aanand Prasad 073fdaf671 Universally-compatible reading of chunked streams
Docker introduced newlines in stream output in version 0.9
(https://github.com/dotcloud/docker/pull/4276), but not to all
endpoints - POST /images/create, for example, does not include them.

This reverts to the old, less pleasant implementation of
_stream_helper(), with a manual check for newlines to fix the problem
described in #176 and fixed in #184, without the accompanying
regression. It should work against Docker 0.8, 0.9 and 0.10, both when
building and when pulling.
2014-04-28 17:22:14 +01:00
Aanand Prasad fdd39a85cc Fix integration test regression
The test for starting a container with volume binds hadn't been updated
to use the new dictionary structure for the `binds` argument.
2014-04-28 17:18:39 +01: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
Evgeniy L 18d4db09ec Moved APIError exception to docker.errors module. 2014-04-07 13:31:13 +04:00
shin- 8eedbc895e Fixed integration tests 2014-04-04 18:16:47 +02:00
shin- a37d0eea16 Added unit test for create_container with volumes_from 2014-04-04 17:11:00 +02:00
shin- ad75b37a46 Merge branch 'volumes-from-as-list' of github.com:blackrobot/docker-py into blackrobot-volumes-from-as-list 2014-04-04 16:59:57 +02:00
shin- 54c904f806 Updated unit tests API version, flake8 fixes 2014-04-04 16:55:01 +02:00
Joseph Schorr 156d14efd1 Revert unneeded change 2014-04-04 16:47:23 +02:00
Joseph Schorr 9ae3bcd2f3 Make sure the build command in the client sends the auth credentials along. Required for "FROM " lines that pull from private registries 2014-04-04 16:47:23 +02:00
Damon Jablons cdd52a172f Added test for container with volumes_from 2014-04-01 16:08:25 -04: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
Luka Stojanovic 74499e21e4 make flake happy 2014-03-24 16:10:31 +01:00
Luka Stojanovic 030516eb29 parse_repository_tag function and accompanying test 2014-03-24 16:10:31 +01:00
shin- 82f4c271ea Updated integration tests 2014-02-18 19:58:50 +01: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
Maxime Petazzoni ef009e114a Style fixes for flake8
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-12-24 10:07:25 -08:00
Fedor Korotkiy 09f95768f3 Fix infinite loop in Client.logs(stream=True) caused by connection close. 2013-12-24 12:01:16 +00:00
Ulises Reyes d8e0f5a66f Improves code style 2013-12-15 20:42:58 -05:00
Ulises Reyes 844e41088e Refactored test. It now makes 2 calls to port 2013-12-15 02:11:02 -05:00
Ulises Reyes daa3a1e2ef Shortened lines 2013-12-14 22:28:45 -05:00
Ulises Reyes a7c1449757 Improved assertions in the port test 2013-12-14 22:24:19 -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- c0f84ceac0 Fix privileged test 2013-11-15 19:06:19 +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
shin- 4f6f475fd5 Merge branch 'stream-pull-request' of github.com:yukw777/docker-py into yukw777-stream-pull-request 2013-11-11 19:48:52 +01:00
Peter Yu 6c2820835e many tests have been implemented 2013-11-10 02:14:53 +00:00
Peter Yu 97771b1b2b links implemented. use v1.6 by default now 2013-11-10 00:27:10 +00:00
Jessica Gadling 70a5c9b0ca Support the new PublishAllPorts flag. 2013-11-08 21:07:18 -08:00
Maxime Petazzoni a451119e4a Allow for configurable timeout on all client requests
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-11-08 15:19:51 -08:00
yukw777 fdd48cff81 pull, push, build are streamable 2013-11-08 21:08:46 +00:00
shin- 2e66ca8a6c assertIn not supported in py26 2013-11-08 20:43:09 +01:00
shin- 1d1395464c Merge branch 'auth-load-config-fix' of github.com:mpetazzoni/docker-py into mpetazzoni-auth-load-config-fix 2013-11-08 20:38:01 +01:00
yukw777 e0df0c7ad2 pull, push, build are streamable 2013-11-08 19:22:23 +00:00
shin- 8309ae7896 Added unit test for named containers 2013-11-08 19:34:30 +01:00
shin- 78667c19a8 Merge branch 'named-container-create' of github.com:mpetazzoni/docker-py into mpetazzoni-named-container-create 2013-11-08 19:28:35 +01:00
shin- f6159b5593 Fixed lxc_conf param in Client.start to accept dict configurations. Fixes #84 2013-11-08 18:58:10 +01:00
Maxime Petazzoni 9871f8d9ac Don't fail loading the configuration when .dockercfg doesn't exist
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-11-07 15:38:53 -08:00
Maxime Petazzoni afb349d257 Add integration test for named container creation
Signed-off-by: Maxime Petazzoni <max@signalfuse.com>
2013-11-07 15:37:41 -08:00
shin- acd2607407 Flake8 compliance + flake8 tests in tox.ini 2013-10-15 21:15:01 +02:00
shin- 0808905636 Refactoring, Python 3 compatibility, Tests working with python 3, cleaned up imports. 2013-10-15 19:19:20 +02:00
Deni Bertovic 128cdb9112 fixed test list_containers to account for upstream changes 2013-10-03 11:56:44 +02:00
Deni Bertovic afbfc703ca integration test fix
make the mount point for shared.txt reside in the /tmp/ folder
because if it resides in the lib folder docker sets the owner of the
folder as root inside the container so then when the container exists
the test fails to cleanup and remove the shared.txt file, and breaks git as well.
2013-10-03 11:55:02 +02:00
Deni Bertovic 1ce8dc962c python3 fixes
Fixed imports to be compatible with python3 on various places in the client lib
and in the tests themselves.
2013-10-03 11:55:02 +02:00
Deni Bertovic 7fbc41ea7f removed unused FAKE_INSPECT_DATA 2013-10-03 11:51:12 +02:00
Deni Bertovic 7c80127eb7 refactored tests
Using the mock library. Checking that every Client method gets
tested for not raising an Exception and for construting the request
params correctly.
2013-10-03 11:51:12 +02:00
Deni Bertovic 80e11964f1 initial import of unit test and mocks for the docker api 2013-10-03 11:51:12 +02:00
Deni Bertovic 8047fb4cb4 reamed test.py to integration_test.py 2013-10-03 11:51:12 +02:00
shin- e2e5b9e0fd Merge branch 'master' into 0.2.0-dev 2013-09-12 00:00:06 +02:00
shin- c8e5a6dab1 Methods that previously supported multi-args are now single-argument. Doc and tests updated accordingly. 2013-09-11 23:44:58 +02:00
shin- c132d2b70d Fixed tests 2013-09-11 21:20:42 +02:00
shin- 9a92d68cf1 Merge branch 'better-error-reporting' of git://github.com/aanand/docker-py into 0.2.0-dev
Conflicts:
	docker/__init__.py
	docker/client.py
2013-09-11 21:14:42 +02:00
shin- 208fb0366f Use pseudo-constant for index URL 2013-09-10 20:38:14 +02:00
shin- 26933543fe Added license header to .py files 2013-09-10 20:34:03 +02:00
shin- 99c9eadc82 Cleanup, externalized into modules, fixed auth 2013-09-10 20:31:03 +02:00
Deni Bertovic f032ecfe47 Fixed #33 - make client commands more consistent 2013-09-04 15:53:37 +02:00
Evan Hazlett ea087b7b15 added privileged container support 2013-08-30 09:35:09 -04:00
shin- c0d8b2ef09 Fixed tests 2013-08-28 18:39:26 +02:00
shin- 17a6994e43 Docker client now tries to load the auth config. This is necessary to use the push command if API version is >1.0 2013-08-06 19:57:20 +02:00
shin- 4f7872da87 Fixed tests 2013-07-25 20:18:38 +02:00
shin- 7e415dd234 Fixing failed merge 2013-07-15 19:04:24 +02:00
shin- 4488be3678 Fixed tests 2013-07-15 19:02:48 +02:00
Mike Neilsen b981f9a6de Create tests module for setuptools test support
Run test suite via

  python setup.py test

Signed-off-by: Mike Neilsen <mneilsen@acm.org>
2013-07-13 01:07:04 -05:00
Enrico cf47df1b3e Removed duplicated import. 2013-07-11 18:05:19 -03:00
Enrico a863acce87 Added ability to create binds when starting a container. 2013-07-11 17:54:36 -03:00
Enrico 2551105320 Merge branch 'upstream-master' into bind-mounts
Conflicts:
	tests/test.py
2013-07-05 16:23:37 -03:00
Enrico c2a145c2d8 Added ability to create binds when starting a container. 2013-07-05 15:25:52 -03:00
Joffrey F d03d4fb5ca Merge pull request #15 from elbaschid/add_python3_support
Make docker-py compatible with python 3
2013-07-05 10:31:24 -07:00
shin- 2c186304a8 Added test for Client.build 2013-07-05 19:04:38 +02:00
Sebastian Vetter 48ed4a1d2e Add python 3 support 2013-07-06 00:32:28 +10:00
shin- b7e1ac7069 Fixed logs command 2013-07-03 22:19:41 +02:00
shin- e62bc3bd92 Small test fixes 2013-07-03 21:49:31 +02:00
shin- 66d22c9bba Tests for execution control, run commands as strings, commit/pull (still WIP) 2013-06-24 21:31:59 +02:00
shin- 3305949257 (WIP) Added unit tests 2013-06-21 19:59:36 +02:00