This commit is contained in:
Mateusz Zakarczemny 2025-01-23 10:20:30 +00:00 committed by GitHub
commit ccbee9489f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View File

@ -65,6 +65,11 @@ class DockerClient:
A path to a directory containing TLS certificates to use when
connecting to the Docker host.
.. envvar:: DOCKER_API_VERSION
A path to a directory containing TLS certificates to use when
connecting to the Docker host.
Args:
version (str): The version of the API to use. Set to ``auto`` to
automatically detect the server's version. Default: ``auto``

View File

@ -367,6 +367,8 @@ def kwargs_from_env(environment=None):
tls_verify = tls_verify is not None
enable_tls = cert_path or tls_verify
docker_api_version = environment.get('DOCKER_API_VERSION')
params = {}
if host:
@ -385,6 +387,8 @@ def kwargs_from_env(environment=None):
verify=tls_verify,
)
params['version'] = docker_api_version
return params