From 3e605d38cd98eec743b773033eec46c1a27f1e75 Mon Sep 17 00:00:00 2001 From: jason Date: Thu, 25 Jul 2019 23:56:07 +0900 Subject: [PATCH] update --- container/container.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/container/container.go b/container/container.go index 5018c56..1c8cdb2 100644 --- a/container/container.go +++ b/container/container.go @@ -1310,6 +1310,7 @@ func DockerMerge(name, user, pass string) *Error { if ierr != nil { return ierr } + //new layer name : size ret[new_image_name] = size mdata["layer"] = ret mdata["layer_order"] = new_image_name @@ -1326,16 +1327,12 @@ func DockerMerge(name, user, pass string) *Error { var docinfo DockerInfo docinfo.Name = name layersmap := make(map[string]int64) + //sha256:size for k, v := range ret { layersmap[path.Base(k)] = v } docinfo.LayersMap = layersmap - - var layer_sha []string - for _, layer := range layer_order { - layer_sha = append(layer_sha, path.Base(layer)) - } - docinfo.Layers = strings.Join(layer_sha, ":") + docinfo.Layers = sha256 dinfodata, _ := StructMarshal(docinfo) err = WriteToFile(dinfodata, fmt.Sprintf("%s/.info", mdata["rootdir"].(string)))