summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
Diffstat (limited to 'docker')
-rw-r--r--docker/utils/utils.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py
index 4404c21..61e5a8d 100644
--- a/docker/utils/utils.py
+++ b/docker/utils/utils.py
@@ -128,7 +128,13 @@ def exclude_paths(root, patterns, dockerfile=None):
paths = get_paths(root, exclude_patterns, include_patterns,
has_exceptions=len(exceptions) > 0)
- return set(paths)
+ return set(paths).union(
+ # If the Dockerfile is in a subdirectory that is excluded, get_paths
+ # will not descend into it and the file will be skipped. This ensures
+ # it doesn't happen.
+ set([dockerfile])
+ if os.path.exists(os.path.join(root, dockerfile)) else set()
+ )
def should_include(path, exclude_patterns, include_patterns):