Skip to content

Commit

Permalink
Merge pull request moby#48517 from grautxo/48516-release-layer-on-con…
Browse files Browse the repository at this point in the history
…tainer-export

Releases container layer on docker export
  • Loading branch information
vvoland authored Oct 21, 2024
2 parents e038410 + 1aba291 commit e3c4ed1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions daemon/images/image_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ func (i *ImageService) PerformWithBaseFS(ctx context.Context, c *container.Conta
if err != nil {
return err
}

defer func() {
err := i.ReleaseLayer(rwlayer)
if err != nil {
err2 := i.ReleaseLayer(rwlayer)
if err2 != nil {
log.G(ctx).WithError(err2).WithField("container", c.ID).Warn("Failed to release layer")
}
log.G(ctx).WithError(err).WithField("container", c.ID).Warn("Failed to release layer")
}
}()

Expand All @@ -39,6 +38,8 @@ func (i *ImageService) PerformWithBaseFS(ctx context.Context, c *container.Conta
return err
}

defer rwlayer.Unmount()

return fn(basefs)
}

Expand Down

0 comments on commit e3c4ed1

Please sign in to comment.