Browse Source

Merge pull request #30206 from coolljt0725/fix_save_share_layers

Follow #28926, fix docker save can't share layers in the tar archive.
Aaron Lehmann 8 years ago
parent
commit
3c82a9bc27
1 changed files with 3 additions and 1 deletions
  1. 3 1
      image/tarexport/save.go

+ 3 - 1
image/tarexport/save.go

@@ -234,7 +234,9 @@ func (s *saveSession) saveImage(id image.ID) (map[layer.DiffID]distribution.Desc
 	var foreignSrcs map[layer.DiffID]distribution.Descriptor
 	for i := range img.RootFS.DiffIDs {
 		v1Img := image.V1Image{
-			Created: img.Created,
+			// This is for backward compatibility used for
+			// pre v1.9 docker.
+			Created: time.Unix(0, 0),
 		}
 		if i == len(img.RootFS.DiffIDs)-1 {
 			v1Img = img.V1Image