mirror of https://github.com/docker/docker-py.git
Merge pull request #337 from heewa/catch_invalid_build
Catch invalid path in build method
This commit is contained in:
commit
b93fca639e
|
@ -406,6 +406,8 @@ class Client(requests.Session):
|
||||||
elif path.startswith(('http://', 'https://',
|
elif path.startswith(('http://', 'https://',
|
||||||
'git://', 'github.com/')):
|
'git://', 'github.com/')):
|
||||||
remote = path
|
remote = path
|
||||||
|
elif not os.path.isdir(path):
|
||||||
|
raise TypeError("You must specify a directory to build in path")
|
||||||
else:
|
else:
|
||||||
dockerignore = os.path.join(path, '.dockerignore')
|
dockerignore = os.path.join(path, '.dockerignore')
|
||||||
exclude = None
|
exclude = None
|
||||||
|
|
Loading…
Reference in New Issue