mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-09-30 10:01:35 +02:00
* 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.
20 lines
573 B
Plaintext
20 lines
573 B
Plaintext
# This dockerfile makes sure the .dockerignore is working
|
|
# If so then ignore/foo should copy to /foo
|
|
# If not, then this image won't build because it will attempt to copy three files to /foo, which is a file not a directory
|
|
FROM scratch as base
|
|
COPY ignore/* /foo
|
|
|
|
From base as first
|
|
COPY --from=base /foo ignore/bar
|
|
|
|
# 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/
|