Releases: aio-libs/aiodocker
Releases · aio-libs/aiodocker
0.27.0
Breaking Changes
images.push(),images.pull(),images.build(), andimages.import_image()now raiseDockerStreamErrorwhen the Docker Engine reports an error in the progress stream, instead of silently returning the error chunk as part of the response. Existingexcept DockerErrorblocks continue to catch these failures becauseDockerStreamErroris a subclass. Callers that intentionally inspected the returned list for anerrorkey must update their code to catch the exception instead. (#445)images.pull()(and itsDocker.pullalias) no longer triggers the Docker Engine's "pull all tags" behavior whentagis omitted andfrom_imagehas no embedded tag or digest; it now pulls"latest"instead. Callers that relied on the previous all-tags behavior must passtag=""explicitly to opt back in. (#974)- Raise the minimum required
aiohttpto>=3.11.13. Earlier releases contain abreakinside afinallyblock inaiohttp/web_protocol.pywhich Python 3.14 turns into aSyntaxWarningunder PEP 765; the offending code was fixed in aiohttp 3.11.13 (aio-libs/aiohttp#10434, backported in #10476). The 3.10 series is end-of-life. The CI test matrix now exercisesaiohttp~=3.11.0andaiohttp~=3.13.0instead of 3.10 and 3.13. (#1038)
Bug Fixes
- Fix
DockerSwarm.join()so the request body is JSON-encoded. The endpoint previously sent a form-encoded body with aContent-Type: application/jsonheader, causing the daemon to reject the request with a JSON decode error. (#288) - Raise
DockerStreamError(aDockerErrorsubclass) when the Docker Engine reports an error inside the JSON progress stream returned byimages.push(),images.pull(),images.build(), andimages.import_image(). Previously these calls returnedHTTP 200from the Engine even when the upstream registry rejected the operation (e.g.403 Forbiddenfrom Nexus or Docker Hub), and the error chunk was silently included in the returned list, giving callers no way to detect the failure. (#445) - Vendor
FlowControlDataQueuefrom aiohttp since it is deprecated and will be removed in aiohttp 4.0, and pinaiohttp<4.0until the dependency is migrated off the class. (#919) - Fix container membership check by renaming the misspelled
__hasitem__to__contains__so theinoperator works onDockerContainerinstances. (#967) - Default
images.pull()to the"latest"tag when neither atagargument nor an embedded tag/digest infrom_imageis provided, matching the behavior of thedocker pullCLI. (#974) - Fix the inverted condition in
Stream.__del__so aResourceWarningis emitted when a stream is garbage-collected while still holding a live, unclosed response. (#1033) - Stop closing caller-supplied
sessionandconnectorfrom :meth:Docker.close; only resources created internally are torn down, and :meth:Docker.closeis now idempotent. (#1034)
New Features
- Accept a typed
filtersmapping inDockerImages.list()(e.g.{"dangling": ["true"]}), matching the style ofvolumes.list(),networks.list(), andimages.prune(). A pre-encoded JSON string is still accepted for backwards compatibility, but emits aDeprecationWarningand will be removed in 1.0. (#696) - Add :py:meth:
DockerContainer.topto expose thecontainers/{id}/topAPI endpoint, accepting an optionalps_argsargument. (#959)
Miscellaneous
- Document how to bind-mount a host directory via
HostConfig.BindsandHostConfig.Mounts, including bind-propagation options (shared,slave, etc.) and the host-sidemount --make-sharedprerequisite -- by :user:achimnol. (#614) - Document
docker.containers.list(all=True)for listing stopped containers, and note that any keyword argument is forwarded as a query parameter to the Docker EngineGET /containers/jsonendpoint -- by :user:achimnol. (#831) - Replace a fixed five second sleep in the container log test helper with a follow stream read, so the helper waits only as long as the daemon takes to flush log output -- by :user:
bdraco. (#1020) - Replace a fixed ten second sleep in the non-TTY attach exit test with a wait for container exit, so the test returns as soon as the container actually finishes -- by :user:
bdraco. (#1023) - Build the distribution with
uv buildand runtwinethroughuvxin CI, dropping the dedicatedpip installsteps forbuildandtwine-- by :user:bdraco. (#1026) - Replace legacy type annotations with Python3.10+ versions. (#1028)
- Make
uvthe default development setup: trackuv.lockin git, switch theMakefile,test.sh, and the README development docs touv sync/uv run(with a pip-based fallback documented), and convert the CIlintandtestjobs to useastral-sh/setup-uvwith the matrix Python viaUV_PYTHON_PREFERENCE=only-system. (#1038)
0.26.0
New Features
- Introduce support in the library for the
networks/pruneAPI endpoint. (#691) - Introduce support in the library for the
images/pruneAPI endpoint. (#1001) - Introduce support in the library for the
containers/pruneAPI endpoint. (#1002) - Introduce support in the library for the
volumes/pruneAPI endpoint. (#1003) - Introduce support in the library for the
build/pruneAPI endpoint. (#1007)
Miscellaneous
- Fix entrypoint usage in broken container tests to unblock CI. (#1004)
0.25.0
Breaking Changes
- Drop Python 3.9 support and add Python 3.14 support, updating dependencies such as aiohttp (minimum 3.8 to 3.10) and async-timeout (minimum to 5.0) for stdlib TaskGroup and timeout compatibility in Python 3.11+ (#976)
- Replace
**kwargswith explicit parameters inDockerContainer.{stop,restart,kill,delete}()methods, acceptingtfor server-side stop timeout andtimeoutfor client-side request timeouts for consistency with other methods covered in the previous PRs #983 and #990; since this is a BREAKING CHANGE for those who have used thetimeoutargument for theDockerContainer.restart()method calls, the users should replace it withtto keep the intended semantics (#991)
Bug Fixes
- Fix issue authenticating against private registries where the
X-Registry-Authheader would require URL-safe substitutions. (#941)
New Features
- Add support for Docker context endpoints with TLS, reading configuration from
~/.docker/contexts/and respectingDOCKER_CONTEXTenvironment variable andSkipTLSVerifyoption. (#811) - Add SSH protocol support for secure connections to remote Docker instances via "ssh://" URLs with mandatory host key verification (#982)
- Introduce the client-level
timeoutconfiguration which becomes the base timeout configuration while still allowing legacy individual per-API timeouts and merging it into the base timeout. Now setting individual float (total) timeout per-API call is HIGHLY DISCOURAGED in favor of composable timeouts via stdlib'sasyncio.timeout()async context manager. (#983)
Miscellaneous
- Improve the CI workflows to expand the test matrix for aiohttp 3.10/3.13 releases and let tests use the prebuilt artifact to ensure consistency with the release (#980)
- Isolate the docker instance for swarm and service tests via a docker-in-docker compose stack to avoid affecting the user environment (#981)
- Apply the default cooldown period (7 days) to the dependabot configuration (#984)
0.24.0
0.23.0
Features
- Introduce a sentinel value to
_do_query()and its friend methods to allow configuring per-request infinite timeouts instead of always falling back to the session-level default timeout when setting the timeout argument toNone, and add the timeout arguments to image-related API wrappers (#900)
0.22.2
0.22.1
0.22.0
NOTICE: This release drops support for Python 3.7 and older. Please upgrade your Python version or keep using prior releases.
Features
- Adds the force parameter to
DockerVolume.delete()(#690) - Migrate from setuptools to hatch. To install the package and all dependencies, use "pip install .[dev,doc]". (#848)
Bugfixes
- Support additional parameters in swarm init (#323)
- Fixes unittests that don't run locally due to deprecations in later versions of Docker. Tested with 26.00, v1.45. (#849)
- Fix never-awaited coroutines of
_AsyncCMto close when handling errors (#861)
Misc
0.22.0a1
Features
- Add support for filters when listing networks.
Add support for filters when listing volumes.
Add get option for fetching volumes by name or id. (#623)
Improved Documentation
- Update the documentation examples to use the modern
asyncio.run()pattern and initializeaiodocker.Docker()instance inside async functions where there is a valid running event loop (#837)
Deprecations and Removals
- Starting container with non-empty request body was deprecated since API v1.22 and removed in v1.24 (#660)