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

Only add whiteout files once #270

Merged
merged 3 commits into from
Aug 2, 2018

Conversation

priyawadhwa
Copy link
Collaborator

I found a bug when building this Dockerfile -- whiteouts were being added in every layer after the command which removed the files. This was causing extra layers to be built.

I added functions to LayeredMap similar to the ones already there so that a whiteout file is only added once.

filesAdded = true
if err := util.Whiteout(path, w); err != nil {
return false, err
maybeAdd, err := s.l.MaybeAddWhiteout(path)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this boolean should probably be called something like "addWhiteout"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@priyawadhwa priyawadhwa merged commit 71c83e3 into GoogleContainerTools:master Aug 2, 2018
@priyawadhwa priyawadhwa deleted the layers branch August 2, 2018 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants