From 0146c80c40fa5b793fdda17ed2c96d49bd90e2ed Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Sat, 23 Mar 2013 14:48:16 -0700 Subject: [PATCH] An image embeds the configuration of its parent container ('ContainerConfig') --- commands.go | 2 +- graph.go | 4 ++-- image.go | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index 16f97f12dd..30e0a82546 100644 --- a/commands.go +++ b/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 }) diff --git a/graph.go b/graph.go index c6bb30353a..fed19175ff 100644 --- a/graph.go +++ b/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 diff --git a/image.go b/image.go index 36bd839f5c..1a417a357b 100644 --- a/image.go +++ b/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 }