Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for .dockerignore file #394

Merged
merged 5 commits into from
Oct 30, 2018

Conversation

priyawadhwa
Copy link
Collaborator

@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
Collaborator

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 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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore files in .dockerignore
4 participants