diff --git a/compose/service.py b/compose/service.py index 53cf42ae8..716a75574 100644 --- a/compose/service.py +++ b/compose/service.py @@ -1855,7 +1855,7 @@ class _CLIBuilder: Returns: A generator for the build output. """ - if dockerfile: + if dockerfile and os.path.isdir(path): dockerfile = os.path.join(path, dockerfile) iidfile = tempfile.mktemp()