Переглянути джерело

An image embeds the configuration of its parent container ('ContainerConfig')

Solomon Hykes 12 роки тому
батько
коміт
0146c80c40
3 змінених файлів з 5 додано та 5 видалено
  1. 1 1
      commands.go
  2. 2 2
      graph.go
  3. 2 2
      image.go

+ 1 - 1
commands.go

@@ -311,7 +311,7 @@ func (srv *Server) CmdHistory(stdin io.ReadCloser, stdout io.Writer, args ...str
 		fmt.Fprintf(w, "%s\t%s\t%s\n",
 			srv.runtime.repositories.ImageName(img.Id),
 			HumanDuration(time.Now().Sub(img.Created))+" ago",
-			strings.Join(img.ParentCommand, " "),
+			strings.Join(img.ContainerConfig.Cmd, " "),
 		)
 		return nil
 	})

+ 2 - 2
graph.go

@@ -55,8 +55,8 @@ func (graph *Graph) Create(layerData Archive, container *Container, comment stri
 	}
 	if container != nil {
 		img.Parent = container.Image
-		img.ParentContainer = container.Id
-		img.ParentCommand = append([]string{container.Path}, container.Args...)
+		img.Container = container.Id
+		img.ContainerConfig = *container.Config
 	}
 	if err := graph.Register(layerData, img); err != nil {
 		return nil, err

+ 2 - 2
image.go

@@ -19,8 +19,8 @@ type Image struct {
 	Parent          string    `json:"parent,omitempty"`
 	Comment         string    `json:"comment,omitempty"`
 	Created         time.Time `json:"created"`
-	ParentContainer string    `json:"parent_container,omitempty"`
-	ParentCommand   []string  `json:"parent_command,omitempty"`
+	Container       string    `json:"container,omitempty"`
+	ContainerConfig Config    `json:"container_config,omitempty"`
 	graph           *Graph
 }