Files
kaniko/integration/dockerfiles/Dockerfile_test_dockerignore
T
Tinjo Schöni 5f4e2f1366 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.
2020-10-08 12:47:14 -07:00

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/