Skip to content

Commit

Permalink
Improve extra_files override check
Browse files Browse the repository at this point in the history
Signed-off-by: Joffrey F <joffrey@docker.com>
  • Loading branch information
shin- committed Mar 27, 2018
1 parent 3fdc012 commit 899f3cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker/utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 899f3cf

Please sign in to comment.