Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Add support for .dockerignore file#394

Merged
priyawadhwa merged 5 commits intoGoogleContainerTools:masterfrom
priyawadhwa:ignore
Oct 30, 2018
Merged

Add support for .dockerignore file#394
priyawadhwa merged 5 commits intoGoogleContainerTools:masterfrom
priyawadhwa:ignore

Conversation

@priyawadhwa
Copy link
Copy Markdown
Contributor

@priyawadhwa priyawadhwa commented Oct 12, 2018

kaniko should support the .dockerignore file. If it finds one in the build context, it will parse the file and delete all matching paths from the build context. It will then delete the .dockerignore before starting the build.
Should fix #384

Added a --ignore flag to ignore packages and files in the build context.
This should mimic the .dockerignore file. Before starting the build, we
go through and delete ignored files from the build context.
It seems like .dockerignore deletes files containeed within the file locally upon
docker build, so I created a temporary test dir to make sure the
--ignore flag works. We make sure it exists before building docker and
kaniko for Dockerfile_test_ignore, and then delete it after the builds
have completed.
@dlorenc
Copy link
Copy Markdown
Contributor

dlorenc commented Oct 15, 2018

What's the overall plan here? Is kaniko going to add support for parsing .dockerignore files, or are we doing to expect users to set this flag?

@priyawadhwa priyawadhwa changed the title Add --ignore flag Add support for .dockerignore file Oct 19, 2018
@priyawadhwa priyawadhwa force-pushed the ignore branch 3 times, most recently from efa3321 to d2dc342 Compare October 19, 2018 22:32
@priyawadhwa priyawadhwa merged commit 6ef616b into GoogleContainerTools:master Oct 30, 2018
@priyawadhwa priyawadhwa deleted the ignore branch October 30, 2018 23:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ignore files in .dockerignore

4 participants