summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docker/utils/build.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/docker/utils/build.py b/docker/utils/build.py
index 783273e..b644c9f 100644
--- a/docker/utils/build.py
+++ b/docker/utils/build.py
@@ -152,8 +152,9 @@ def create_archive(root, files=None, fileobj=None, gzip=False,
t = tarfile.open(mode='w:gz' if gzip else 'w', fileobj=fileobj)
if files is None:
files = build_file_list(root)
+ extra_names = set(e[0] for e in extra_files)
for path in files:
- if path in [e[0] for e in extra_files]:
+ if path in extra_names:
# Extra files override context files with the same name
continue
full_path = os.path.join(root, path)