taskcat
taskcat copied to clipboard
fix(#798): Honor DOCKER_HOST environment variable for Docker API client
Overview
TaskCat fails when running in Kubernetes with contained runtime or in GitLab pipeline due to Docker daemon connection errors.
Testing/Steps taken to ensure quality
See issue #798. As long as the UNIX socket is not available, the error happens.
Solution
Allow users to specify a custom Docker host via the DOCKER_HOST environment variable, which is passed to the Docker APIClient constructor.
Changes
- Docker APIClient now uses
DOCKER_HOSTif set, otherwise defaults tounix://var/run/docker.sock
Testing Instructions
Test in an environment that the Docker daemon's UNIX socket is not accessible by the client, for example in a GitLab pipleine with docker:dind service.
I am not familiar with this... what should I do to make "Static Analysis" green?