Skip to content

Commit

Permalink
Merge pull request moby#8813 from jlhawn/aufs_exclude_on_tar_layer
Browse files Browse the repository at this point in the history
Exclude `.wh..wh.*` AUFS metadata on layer export
  • Loading branch information
tiborvass committed Nov 4, 2014
2 parents edae883 + 0d97e08 commit 6718791
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions daemon/graphdriver/aufs/aufs.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ 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.*"},
})
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,9 @@ func TarWithOptions(srcPath string, options *TarOptions) (io.ReadCloser, error)
}

relFilePath, err := filepath.Rel(srcPath, filePath)
if err != nil {
if err != nil || (relFilePath == "." && f.IsDir()) {
// Error getting relative path OR we are looking
// at the root path. Skip in both situations.
return nil
}

Expand Down

0 comments on commit 6718791

Please sign in to comment.