Upgrade Notes
docker.from_env()now honors the active Docker CLI context whenDOCKER_HOSTis not set.- This means the client may connect to the daemon selected by
DOCKER_CONTEXTor the current context in~/.docker/config.json, matching Docker CLI behavior more closely. - If your application relied on the previous default connection behavior, set
DOCKER_HOSTexplicitly, setDOCKER_CONTEXT=default, or passuse_context=FalsetoDockerClient.from_env().
- This means the client may connect to the daemon selected by
- Added
docker.from_context()/DockerClient.from_context()for explicitly creating a client from a Docker CLI context.
Features
- Added support for Docker contexts when creating the default client
- Added subpath support for volumes
Bugfixes
- Fixed
exec_rundocumentation for thestreamparameter - Fixed image loading to avoid depending on the deprecated
JSONMessage.errorfield - Preserved the rotated unlock key in swarm integration tests
- Fixed SSL certificate generation in tests
- Fixed IPv6 integration tests by explicitly enabling IPv6 where required
Miscellaneous
- Updated tests for newer Docker Engine behavior
- CI and build updates
What's Changed
- tests/exec: expect 127 exit code for missing executable by @laurazard in #3290
- fixing doc for stream param in exec_run by @yasonk in #3292
- Bump default API version to 1.45 (Moby 26.0/26.1) by @thaJeztah in #3261
- Set a dummy-version if none set, and remove unused APT_MIRROR build-arg by @thaJeztah in #3267
- test_service_logs: stop testing experimental versions by @thaJeztah in #2442
- Makefile: fix circular reference for integration-dind by @thaJeztah in #3297
- image load: don't depend on deprecated JSONMessage.error field by @thaJeztah in #3307
- integration: test_create_volume_invalid_driver allow either 400 or 404 by @thaJeztah in #3296
- integration: adjust tests for omitted "OnBuild" by @thaJeztah in #3336
- Implement Subpath Support for Volumes in Docker-Py (#3243) by @Khushiyant in #3270
- tests: fix ssl generation by @thaJeztah in #3365
- test/integration: don't check for deprecated Networks field by @thaJeztah in #3362
- test: Skip from_env_unix tests if DOCKER_HOST is network socket by @ricardobranco777 in #3366
- test_connect_with_ipv6_address: enable IPv6 by @robmry in #3372
- test_create_with_ipv6_address: enable IPv6 by @robmry in #3373
- tests: Migrate off gpg2 and regenerate key ed25519 by @vvoland in #3399
- gha: Pin to digests by @vvoland in #3408
- Fix integration tests on non-amd64 hosts and add ARM64 CI by @vvoland in #3407
- integration/swarm: Preserve rotated unlock key by @vvoland in #3410
- [DKP-2535] Honour context if present for default client, add contexts support by @ebriney in #3401
- docs: 7.2.0 changelog by @vvoland in #3415
New Contributors
- @laurazard made their first contribution in #3290
- @yasonk made their first contribution in #3292
- @ricardobranco777 made their first contribution in #3366
- @robmry made their first contribution in #3372
- @ebriney made their first contribution in #3401
Full Changelog: 7.1.0...7.2.0