Skip to content

Conversation

bodnarbm
Copy link
Contributor

@bodnarbm bodnarbm commented Oct 28, 2016

Closes #1276.

Updates the algorithm implemented in #863 to not traverse down into excluded directories if their path is not a prefix for some .dockerignore exception.

I believe this change conforms with the current handling for dockerignore exceptions by docker itself.

Signed-off-by: Brandon Bodnar bodnarbm@gmail.com

@dnephin
Copy link
Contributor

dnephin commented Oct 31, 2016

A test would be great

@bodnarbm
Copy link
Contributor Author

bodnarbm commented Oct 31, 2016

I should be able to add some unit tests for the should_check_directory function this evening.

@bodnarbm
Copy link
Contributor Author

bodnarbm commented Nov 1, 2016

I added some unit tests for the new should_check_directory function in docker/utils/utils.py

The overall behavior of processing .dockerignore when creating the tar should still be covered by the integration tests added in #863.

@shin- shin- added this to the 1.11.0 milestone Nov 3, 2016
Copy link
Contributor

@shin- shin- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

… exceptions

Fixes an issue where all files in a rather large excluded folder are traversed and examined when creating the build context for potential exception to the exclusion, even though the exclusion rule is for a completely unrelated folder.

Signed-off-by: Brandon Bodnar <bodnarbm@gmail.com>
Signed-off-by: Brandon Bodnar <bodnarbm@gmail.com>
@bfirsh
Copy link
Contributor

bfirsh commented Nov 29, 2016

LGTM

Thanks!

@bfirsh bfirsh merged commit 6a16ede into docker:master Nov 29, 2016
@bodnarbm bodnarbm deleted the do-not-traverse-ignored-directories-with-no-potential-exceptions branch November 29, 2016 23:59
@shin- shin- modified the milestones: 1.11.0, 2.0.0 Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Creating build context may take a long time when dockerignore contains an exception to a rule

5 participants