Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions buildrunner/docker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,17 @@ def new_client(
args["timeout"] = MAX_TIMEOUT
else:
args["timeout"] = timeout
return Client(
base_url=_dockerd_url, version=DOCKER_API_VERSION, tls=tls_config, **args
)
try:
return Client(
base_url=_dockerd_url, version=DOCKER_API_VERSION, tls=tls_config, **args
)
except docker.errors.DockerException as e:
if "Connection aborted" in str(e) and "No such file or directory" in str(e):
raise BuildRunnerContainerError(
"Error connecting to Docker daemon. Please ensure the Docker daemon is running and try again."
)
else:
raise BuildRunnerContainerError(f"An docker error occurred: {e}")


def force_remove_container(docker_client, container):
Expand Down
Loading