Skip to content

Commit 0c948c7

Browse files
committed
Add note about potential dockerignore optimization.
Signed-off-by: mefyl <[email protected]>
1 parent 3b464f9 commit 0c948c7

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docker/utils/build.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ def match(p):
9595
# be included.
9696
if all(not p[0] for p in sub) and not matched:
9797
continue
98+
# I think this would greatly speed up dockerignore handling by not
99+
# recursing into directories we are sure would be entirely
100+
# included, and only yielding the directory itself, which will be
101+
# recursively archived anyway. However the current unit test expect
102+
# the full list of subfiles and I'm not 100% sure it would make no
103+
# difference yet.
104+
# if all(p[0] for p in sub) and matched:
105+
# yield f
106+
# continue
98107
children = False
99108
for r in (os.path.join(f, p) for p in walk(cur, sub, matched)):
100109
yield r

0 commit comments

Comments
 (0)