Skip to content

Commit

Permalink
AUFS Diff/ApplyDiff excludes /.wh..wh.* files
Browse files Browse the repository at this point in the history
Also includes Checksum field in `docker inspect` output for images.
Correcly close layerData decompress/reader wrapper when storing images.
Remove imgJSON from call to graph.Register when pulling an image.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
  • Loading branch information
Josh Hawn committed Oct 27, 2014
1 parent e37eba2 commit 4d6216c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion daemon/graphdriver/aufs/aufs.go
Expand Up @@ -300,11 +300,14 @@ func (a *Driver) Diff(id, parent string) (archive.Archive, error) {
// AUFS doesn't need the parent layer to produce a diff.
return archive.TarWithOptions(path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
Compression: archive.Uncompressed,
Excludes: []string{".wh..wh.*"},
})
}

func (a *Driver) applyDiff(id string, diff archive.ArchiveReader) error {
return archive.Untar(diff, path.Join(a.rootPath(), "diff", id), nil)
return archive.Untar(diff, path.Join(a.rootPath(), "diff", id), &archive.TarOptions{
Excludes: []string{".wh..wh."},
})
}

// DiffSize calculates the changes between the specified id
Expand Down
2 changes: 1 addition & 1 deletion graph/pull.go
Expand Up @@ -576,7 +576,7 @@ func (s *TagStore) pullV2Tag(eng *engine.Engine, r *registry.Session, out io.Wri
defer d.tmpFile.Close()
d.tmpFile.Seek(0, 0)
if d.tmpFile != nil {
err = s.graph.Register(d.img, d.imgJSON,
err = s.graph.Register(d.img,
utils.ProgressReader(d.tmpFile, int(d.length), out, sf, false, utils.TruncateID(d.img.ID), "Extracting"))
if err != nil {
return false, err
Expand Down
1 change: 1 addition & 0 deletions graph/service.go
Expand Up @@ -101,6 +101,7 @@ func (s *TagStore) CmdLookup(job *engine.Job) engine.Status {
out.Set("Os", image.OS)
out.SetInt64("Size", image.Size)
out.SetInt64("VirtualSize", image.GetParentsSize(0)+image.Size)
out.Set("Checksum", image.Checksum)
if _, err = out.WriteTo(job.Stdout); err != nil {
return job.Error(err)
}
Expand Down
3 changes: 2 additions & 1 deletion image/image.go
Expand Up @@ -87,9 +87,10 @@ func StoreImage(img *Image, layerData archive.ArchiveReader, root string) error
if err != nil {
return err
}
defer layerData.Close()

// Wrap with tarsum.
tarsumLayerData, err := tarsum.NewTarSum(layerData, true, tarsum.Version0)
tarsumLayerData, err := tarsum.NewTarSum(layerData, true, tarsum.VersionDev)
if err != nil {
return err
}
Expand Down

0 comments on commit 4d6216c

Please sign in to comment.