Skip to content

builder: fix layer lifecycle leak #36338

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

Merged
merged 1 commit into from
Feb 26, 2018
Merged

Conversation

tonistiigi
Copy link
Member

fixes docker/for-linux#135
fixes #35641

Signed-off-by: Tonis Tiigi tonistiigi@gmail.com

@codecov
Copy link

codecov bot commented Feb 17, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@ee9abc2). Click here to learn what that means.
The diff coverage is 2.53%.

@@            Coverage Diff            @@
##             master   #36338   +/-   ##
=========================================
  Coverage          ?   34.06%           
=========================================
  Files             ?      609           
  Lines             ?    46261           
  Branches          ?        0           
=========================================
  Hits              ?    15758           
  Misses            ?    28472           
  Partials          ?     2031

Copy link
Member

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -114,8 +115,8 @@ func (b *Builder) commitContainer(dispatchState *dispatchState, id string, conta
return err
}

func (b *Builder) exportImage(state *dispatchState, imageMount *imageMount, runConfig *container.Config) error {
newLayer, err := imageMount.Layer().Commit()
func (b *Builder) exportImage(state *dispatchState, layer builder.RWLayer, parent *imageMount, runConfig *container.Config) error {
Copy link
Member

Choose a reason for hiding this comment

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

only parent.Image() is used, so maybe accept parent *image.Image instead of imageMount?

Copy link
Member Author

Choose a reason for hiding this comment

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

replaced with builder.Image

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi
Copy link
Member Author

cc @vdemeester @AkihiroSuda

Copy link
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM 🐯

@thaJeztah
Copy link
Member

Looks like this introduced a regression; #37077 (comment)

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.

Files leaking to other images in a multi-stage build Multi-stage cache bringing back deleted files
6 participants