From f45f739e84d625efc144400f93b27dcda409b355 Mon Sep 17 00:00:00 2001 From: Michael Schuster Date: Mon, 25 Nov 2024 18:34:00 +0100 Subject: [PATCH] Improve error message when docker daemon is not reachable (#3214) --- src/zenml/image_builders/local_image_builder.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/zenml/image_builders/local_image_builder.py b/src/zenml/image_builders/local_image_builder.py index 5a918e934f..91aab432c3 100644 --- a/src/zenml/image_builders/local_image_builder.py +++ b/src/zenml/image_builders/local_image_builder.py @@ -68,15 +68,25 @@ def _check_prerequisites() -> None: ) if not docker_utils.check_docker(): + # For 3., this is not supported by the python docker library + # https://github.com/docker/docker-py/issues/3146 raise RuntimeError( - "Unable to connect to the Docker daemon. There are two " + "Unable to connect to the Docker daemon. There are three " "common causes for this:\n" "1) The Docker daemon isn't running.\n" "2) The Docker client isn't configured correctly. The client " "loads its configuration from the following file: " "$HOME/.docker/config.json. If your configuration file is in a " - "different location, set it using the `DOCKER_CONFIG` " - "environment variable." + "different location, set the `DOCKER_CONFIG` environment " + "variable to the directory that contains your `config.json` " + "file.\n" + "3) If your Docker CLI is working fine but you ran into this " + "issue, you might be using a non-default Docker context which " + "is not supported by the Docker python library. To verify " + "this, run `docker context ls` and check which context has a " + "`*` next to it. If this is not the `default` context, copy " + "the `DOCKER ENDPOINT` value of that context and set the " + "`DOCKER_HOST` environment variable to that value." ) def build(