mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-21 00:34:20 +02:00
Fix .dockerignore for build context copies in later stages (#1447)
* Extend .dockerignore integration test with copies in later stages .dockerignore should continue to apply when copying from the build context in later stages, but it currently doesn't * Replace excluded global with passed along FileContext struct This new FileContext struct allows much cleaner handling of context specific file exclusions. The global excluded file state is no longer needed. Additionally this also fixes the issue where excluded files aren't being applied for build context copies in later build stages.
This commit is contained in:
@@ -7,5 +7,13 @@ COPY ignore/* /foo
|
||||
From base as first
|
||||
COPY --from=base /foo ignore/bar
|
||||
|
||||
FROM first
|
||||
COPY --from=first ignore/* /fooAnother/
|
||||
# Make sure that .dockerignore also applies for later stages
|
||||
FROM scratch as base2
|
||||
COPY ignore/* /foo
|
||||
|
||||
From base2 as second
|
||||
COPY --from=base2 /foo ignore/bar
|
||||
|
||||
FROM scratch
|
||||
COPY --from=first ignore/* /fooAnother/
|
||||
COPY --from=second ignore/* /fooAnother2/
|
||||
|
||||
Reference in New Issue
Block a user