github docker/docker-py 7.2.0

7 hours ago

Upgrade Notes

  • docker.from_env() now honors the active Docker CLI context when DOCKER_HOST is not set.
    • This means the client may connect to the daemon selected by DOCKER_CONTEXT or 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_HOST explicitly, set DOCKER_CONTEXT=default, or pass use_context=False to DockerClient.from_env().
  • 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_run documentation for the stream parameter
  • Fixed image loading to avoid depending on the deprecated JSONMessage.error field
  • 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

Full Changelog: 7.1.0...7.2.0

Don't miss a new docker-py release

NewReleases is sending notifications on new releases.