From 39e19c18b8782f97598e02712bdd0e183677bacc Mon Sep 17 00:00:00 2001 From: Heewa Barfchin Date: Sat, 4 Oct 2014 18:14:23 -0400 Subject: [PATCH] Catch invalid path in build method The server responds with an unuseful message (server error EOF), which happens because an empty tar file is sent over. So check in the client, who knows why that's happening and tell the user. --- docker/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/client.py b/docker/client.py index 1ff43cc4..97176de7 100644 --- a/docker/client.py +++ b/docker/client.py @@ -395,6 +395,8 @@ class Client(requests.Session): elif path.startswith(('http://', 'https://', 'git://', 'github.com/')): remote = path + elif not os.path.isdir(path): + raise TypeError("You must specify a directory to build in path") else: dockerignore = os.path.join(path, '.dockerignore') exclude = None