diff --git a/docker_custodian/docker_autostop.py b/docker_custodian/docker_autostop.py index b5e847f..98d0df8 100644 --- a/docker_custodian/docker_autostop.py +++ b/docker_custodian/docker_autostop.py @@ -13,6 +13,7 @@ import docker.errors import requests.exceptions from docker_custodian.args import timedelta_type +from docker.utils import kwargs_from_env log = logging.getLogger(__name__) @@ -66,7 +67,9 @@ def main(): stream=sys.stdout) opts = get_opts() - client = docker.APIClient(version='auto', timeout=opts.timeout) + client = docker.APIClient(version='auto', + timeout=opts.timeout, + **kwargs_from_env()) matcher = build_container_matcher(opts.prefix) stop_containers(client, opts.max_run_time, matcher, opts.dry_run) diff --git a/docker_custodian/docker_gc.py b/docker_custodian/docker_gc.py index 4e57108..51d0881 100644 --- a/docker_custodian/docker_gc.py +++ b/docker_custodian/docker_gc.py @@ -14,6 +14,7 @@ import docker.errors import requests.exceptions from docker_custodian.args import timedelta_type +from docker.utils import kwargs_from_env log = logging.getLogger(__name__) @@ -220,7 +221,9 @@ def main(): stream=sys.stdout) args = get_args() - client = docker.APIClient(version='auto', timeout=args.timeout) + client = docker.APIClient(version='auto', + timeout=args.timeout, + **kwargs_from_env()) if args.max_container_age: cleanup_containers(client, args.max_container_age, args.dry_run)