From f918fca3bf77ebe5845593281382f68e5b166ab3 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 21 Jan 2014 12:52:05 +0100 Subject: [PATCH] archive: Always end directory filenames in tars with / This matches what tar does, and without it the tarsum created by the registry will not match the docker one. Docker-DCO-1.1-Signed-off-by: Alexander Larsson (github: alexlarsson) --- archive/archive.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/archive/archive.go b/archive/archive.go index 1d21018474..727e9289fa 100644 --- a/archive/archive.go +++ b/archive/archive.go @@ -145,6 +145,10 @@ func addTarFile(path, name string, tw *tar.Writer) error { return err } + if fi.IsDir() && !strings.HasSuffix(name, "/") { + name = name + "/" + } + hdr.Name = name stat, ok := fi.Sys().(*syscall.Stat_t)