summaryrefslogtreecommitdiff
path: root/docker/api
Commit message (Collapse)AuthorAgeFilesLines
* Fix container.stats infinite blocking on stream mode (#3120)6.1.1RazCrimson2023-05-071-2/+3
| | | | | | | fix: api - container.stats infinite blocking on stream mode Includes additional test for no streaming Signed-off-by: Bharath Vignesh J K <52282402+RazCrimson@users.noreply.github.com>
* api: update return type of `diff` method (#3115)John Yang2023-05-051-1/+2
| | | Signed-off-by: John Yang <john.yang20@berkeley.edu>
* api: note the data arg may also be a stream in `put_archive` (#2478)Aarni Koskela2023-02-221-1/+1
| | | Signed-off-by: Aarni Koskela <akx@iki.fi>
* api: add `status` parameter to services list (#3093)Lorin Bucher2023-02-161-1/+9
| | | Signed-off-by: Lorin Bucher <lorin@lbtec.dev>
* api: add `one-shot` option to container `stats` (#3089)Andy Roxby2023-02-161-4/+20
| | | Signed-off-by: Andy Roxby <107427605+aroxby-wayscript@users.noreply.github.com>
* exec: fix file handle leak with container.exec_* APIs (#2320)Peter Wu2023-01-132-6/+23
| | | | | | | | | | | | | | | | | | | | | | | Requests with stream=True MUST be closed or else the connection will never be returned to the connection pool. Both ContainerApiMixin.attach and ExecApiMixin.exec_start were leaking in the stream=False case. exec_start was modified to follow attach for the stream=True case as that allows the caller to close the stream when done (untested). Tested with: # Test exec_run (stream=False) - observe one less leak make integration-test-py3 file=models_containers_test.py' -k test_exec_run_success -vs -W error::ResourceWarning' # Test exec_start (stream=True, fully reads from CancellableStream) make integration-test-py3 file=api_exec_test.py' -k test_execute_command -vs -W error::ResourceWarning' After this change, one resource leak is removed, the remaining resource leaks occur because none of the tests call client.close(). Fixes https://github.com/docker/docker-py/issues/1293 (Regression from https://github.com/docker/docker-py/pull/1130) Signed-off-by: Peter Wu <pwu@cloudflare.com> Co-authored-by: Milas Bowman <milas.bowman@docker.com>
* api: add support for floats to docker logs params since / until (#3031)Rhiza2022-08-191-6/+11
| | | | | | | | Add support for floats to docker logs params `since` / `until` since the Docker Engine APIs support it. This allows using fractional seconds for greater precision. Signed-off-by: Archi Moebius <poerhiz@gmail.com>
* swarm: add support for DataPathPort on init (#2987)Chris Hand2022-08-121-1/+12
| | | | | | Adds support for setting the UDP port used for VXLAN traffic between swarm nodes Signed-off-by: Chris Hand <dexteradeus@users.noreply.github.com>
* Merge remote-tracking branch 'upstream/main' into connect-with-macMilas Bowman2022-08-1213-162/+222
|\
| * docs: add `gzip` arg to `BuildApiMixin` (#2929)Saurav Maheshkar2022-08-021-0/+1
| | | | | | Signed-off-by: Saurav Maheshkar <sauravvmaheshkar@gmail.com>
| * api: add force to plugin disable (#2843)Till!2022-07-291-2/+3
| | | | | | Signed-off-by: till <till@php.net>
| * api: add platform to container create (#2927)Felix Fontein2022-07-291-3/+10
| | | | | | | | | | | | | | Add platform parameter for container creation/run Signed-off-by: Felix Fontein <felix@fontein.de> Signed-off-by: Milas Bowman <milas.bowman@docker.com> Co-authored-by: Milas Bowman <milas.bowman@docker.com>
| * Merge pull request #3009 from milas/lint-flake8Milas Bowman2022-07-264-15/+29
| |\ | | | | | | ci: add flake8 job
| | * lint: fix outstanding flake8 violationsMilas Bowman2022-07-264-15/+29
| | | | | | | | | | | | | | | | | | | | | Since flake8 wasn't actually being run in CI, we'd accumulated some violations. Signed-off-by: Milas Bowman <milas.bowman@docker.com>
| * | client: fix exception semantics in _raise_for_status (#2954)Maor Kleinberger2022-07-261-1/+1
| |/ | | | | | | | | We want "The above exception was the direct cause of the following exception:" instead of "During handling of the above exception, another exception occurred:" Signed-off-by: Maor Kleinberger <kmaork@gmail.com>
| * Merge pull request #2806 from feliperuhland/fix-low-level-volumes-exampleAnca Iordache2021-10-081-3/+3
| |\ | | | | | | Fix volumes low-level documentation examples
| | * Fix volumes low-level documentation examplesFelipe Ruhland2021-04-061-3/+3
| | | | | | | | | | | | | | | | | | | | | I realize that low-level documentation has outdated examples, so I created issue #2800 to fix that Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
| * | Merge pull request #2810 from feliperuhland/fix-low-level-swarm-exampleAnca Iordache2021-10-081-5/+5
| |\ \ | | | | | | | | Fix swarm low-level documentation examples
| | * | Fix swarm low-level documentation examplesFelipe Ruhland2021-04-071-5/+5
| | |/ | | | | | | | | | | | | | | | | | | I realize that low-level documentation has outdated examples, so I created issue #2800 to fix that Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
| * | Merge pull request #2805 from feliperuhland/fix-low-level-network-exampleAnca Iordache2021-10-081-2/+2
| |\ \ | | | | | | | | Fix network low-level documentation examples
| | * | Fix network low-level documentation examplesFelipe Ruhland2021-04-061-2/+2
| | |/ | | | | | | | | | | | | | | | | | | I realize that low-level documentation has outdated examples, so I created issue #2800 to fix that Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
| * | Merge branch 'master' into feat/add_templating_parameter_docker_configAnca Iordache2021-10-0713-54/+43
| |\ \
| | * | Fix getting a read timeout for logs/attach with a tty and slow outputSegev Finer2021-09-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fixes #931 Signed-off-by: Segev Finer <segev208@gmail.com>
| | * | use python3.6+ constructsAnthony Sottile2021-07-0513-53/+37
| | |/ | | | | | | | | | Signed-off-by: Anthony Sottile <asottile@umich.edu>
| * | Add the possibility to set a templating driver when creating a new Docker configSebastiano Mariani2021-06-031-2/+7
| |/ | | | | | | Signed-off-by: Sebastiano Mariani <smariani@vmware.com>
| * Merge pull request #2476 from feliperuhland/add-search-images-limitAnca Iordache2021-04-061-2/+7
| |\ | | | | | | Add limit parameter to image search endpoint
| | * Add limit parameter to image search endpointFelipe Ruhland2021-02-241-2/+7
| | | | | | | | | | | | Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
| * | Merge pull request #2799 from feliperuhland/fix-low-level-pull-exampleAnca Iordache2021-04-061-4/+4
| |\ \ | | | | | | | | Fix images low-level documentation examples
| | * | Fix images low-level documentation examplesFelipe Ruhland2021-04-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I realize that the documentation of low-level `images` was outdated when answering issue #2798 The issue can reproduce it with a simple test: ```py In [1]: import docker In [2]: client = docker.from_env() In [3]: client.pull --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-3-d0931943ca5d> in <module> ----> 1 client.pull ~/docker-py/docker/client.py in __getattr__(self, name) 219 "object APIClient. See the low-level API section of the " 220 "documentation for more details.") --> 221 raise AttributeError(' '.join(s)) 222 223 AttributeError: 'DockerClient' object has no attribute 'pull' In Docker SDK for Python 2.0, this method is now on the object APIClient. See the low-level API section of the documentation for more details. In [4]: client.push --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-4-f7d5b860a184> in <module> ----> 1 client.push ~/docker-py/docker/client.py in __getattr__(self, name) 219 "object APIClient. See the low-level API section of the " 220 "documentation for more details.") --> 221 raise AttributeError(' '.join(s)) 222 223 AttributeError: 'DockerClient' object has no attribute 'push' In Docker SDK for Python 2.0, this method is now on the object APIClient. See the low-level API section of the documentation for more details. In [5]: client.tag --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-5-043bdfd088ca> in <module> ----> 1 client.tag ~/docker-py/docker/client.py in __getattr__(self, name) 219 "object APIClient. See the low-level API section of the " 220 "documentation for more details.") --> 221 raise AttributeError(' '.join(s)) 222 223 AttributeError: 'DockerClient' object has no attribute 'tag' In Docker SDK for Python 2.0, this method is now on the object APIClient. See the low-level API section of the documentation for more details. In [6]: client.get_image --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-6-477c12713276> in <module> ----> 1 client.get_image ~/docker-py/docker/client.py in __getattr__(self, name) 219 "object APIClient. See the low-level API section of the " 220 "documentation for more details.") --> 221 raise AttributeError(' '.join(s)) 222 223 AttributeError: 'DockerClient' object has no attribute 'get_image' In Docker SDK for Python 2.0, this method is now on the object APIClient. See the low-level API section of the documentation for more details. In [7]: client.api.get_image Out[7]: <bound method ImageApiMixin.get_image of <docker.api.client.APIClient object at 0x7fad6a2037c0>> In [8]: client.api.tag Out[8]: <bound method ImageApiMixin.tag of <docker.api.client.APIClient object at 0x7fad6a2037c0>> In [9]: client.api.pull Out[9]: <bound method ImageApiMixin.pull of <docker.api.client.APIClient object at 0x7fad6a2037c0>> In [10]: client.api.push Out[10]: <bound method ImageApiMixin.push of <docker.api.client.APIClient object at 0x7fad6a2037c0>> ``` Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
| * | | Fix containers low-level documentation examplesFelipe Ruhland2021-04-051-25/+25
| |/ / | | | | | | | | | | | | | | | | | | I realize that low-level documentation has outdated examples, so I created issue #2800 to fix that Signed-off-by: Felipe Ruhland <felipe.ruhland@gmail.com>
| * | Remove support to pre python 3.6set-minimal-python-to-3_6Ulysses Souza2021-03-221-10/+8
| |/ | | | | | | Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
| * Fix doc formattingVlad Romanenko2021-02-102-2/+2
| | | | | | | | Signed-off-by: Vlad Romanenko <vlad.romanenko@hotmail.com>
| * docker/api/image: replace use of deprecated "filter" argumentSebastiaan van Stijn2020-11-261-1/+9
| | | | | | | | | | | | | | | | | | | | The "filter" argument was deprecated in docker 1.13 (API version 1.25), and removed from API v1.41 and up. See https://github.com/docker/cli/blob/v20.10.0-rc1/docs/deprecated.md#filter-param-for-imagesjson-endpoint This patch applies the name as "reference" filter, instead of "filter" for API 1.25 and up. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| * Merge pull request #2511 from daeseokyoun/handle-network-hostGuillaume Tardif2020-11-171-1/+4
| |\ | | | | | | raise an error for binding specific ports in 'host' mode of network
| | * Correct comments on ports_binding and host mode as network_modeDaeseok Youn2020-11-171-4/+2
| | | | | | | | | | | | Signed-off-by: Daeseok Youn <daeseok.youn@navercorp.com>
| | * raise an error for binding specific ports in 'host' mode of networkDaeseok Youn2020-11-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The binding ports are ignored where the network mode is 'host'. It could be a problem in case of using these options together on Mac or Windows OS. Because the limitation that could not use the 'host' in network_mode on Mac and Windows. When 'host' mode is set on network_mode, the specific ports in 'ports' are ignored so the network is not able to be accessed through defined ports by developer. Signed-off-by: Daeseok Youn <daeseok.youn@navercorp.com>
| * | Add max_pool_size parameter (#2699)Mariano Scazzariello2020-11-171-7/+12
| |/ | | | | | | | | | | | | | | | | | | | | | | | | * Add max_pool_size parameter Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com> * Add client version to tests Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com> * Fix parameter position Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
| * Merge pull request #2671 from aiordache/default_tagAnca Iordache2020-10-161-4/+11
| |\ | | | | | | Set image default tag on pull
| | * update `pull` method docsaiordache2020-09-211-2/+4
| | | | | | | | | | | | Signed-off-by: aiordache <anca.iordache@docker.com>
| | * Set image default tag on pullaiordache2020-09-161-3/+8
| | | | | | | | | | | | Signed-off-by: aiordache <anca.iordache@docker.com>
| * | Shell out to SSH client for an ssh connectionaiordache2020-10-131-2/+6
| |/ | | | | | | Signed-off-by: aiordache <anca.iordache@docker.com>
| * set engine version for unit tests to avoid querying the engineaiordache2020-08-201-8/+8
| | | | | | | | Signed-off-by: aiordache <anca.iordache@docker.com>
| * set version to 'auto' to avoid breaking on old engine versionsaiordache2020-08-191-23/+21
| | | | | | | | Signed-off-by: aiordache <anca.iordache@docker.com>
| * Fix memory conversion to bytes (#2645)Anca Iordache2020-08-171-3/+3
| | | | | | | | | | | | | | | | * Fix memory conversion to bytes Co-authored-by: Ulysses Souza <ulysses.souza@gmail.com> Signed-off-by: aiordache <anca.iordache@docker.com>
| * Merge pull request #2520 from Nicceboy/masterAnca Iordache2020-08-071-2/+10
| |\ | | | | | | Disable compression by default when using container:get_archive method
| | * Disable compression by default when using get_archive methodNiklas Saari2020-02-261-2/+10
| | | | | | | | | | | | Signed-off-by: Niklas Saari <niklas.saari@tutanota.com>
| * | Spelling fixes (#2571)Ville Skyttä2020-08-071-1/+1
| | | | | | | | | Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
| * | Add device requests (#2471)Lucidiot2020-08-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add DeviceRequest type Signed-off-by: Erwan Rouchet <rouchet@teklia.com> * Add device_requests kwarg in host config Signed-off-by: Erwan Rouchet <rouchet@teklia.com> * Add unit test for device requests Signed-off-by: Erwan Rouchet <rouchet@teklia.com> * Fix unit test Signed-off-by: Erwan Rouchet <rouchet@teklia.com> * Use parentheses for multiline import Signed-off-by: Erwan Rouchet <rouchet@teklia.com> * Create 1.40 client for device-requests test Signed-off-by: Laurie O <laurie_opperman@hotmail.com> Co-authored-by: Laurie O <laurie_opperman@hotmail.com> Co-authored-by: Bastien Abadie <abadie@teklia.com>
| * | Add support for DriverOpts in EndpointConfigMike Haboustak2020-04-302-2/+5
| |/ | | | | | | | | | | | | Docker API 1.32 added support for providing options to a network driver via EndpointConfig when connecting a container to a network. Signed-off-by: Mike Haboustak <haboustak@gmail.com>
* | Fix mac_address connect usage in network functions && addind appropriate testYuval Goldberg2019-12-191-1/+2
| | | | | | | | Signed-off-by: Yuval Goldberg <yuvigoldi@hotmail.com>