1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

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

This commit is contained in:
Solomon Hykes 2013-03-23 14:48:16 -07:00
parent b809dc4271
commit 0146c80c40
3 changed files with 5 additions and 5 deletions

View file

@ -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", fmt.Fprintf(w, "%s\t%s\t%s\n",
srv.runtime.repositories.ImageName(img.Id), srv.runtime.repositories.ImageName(img.Id),
HumanDuration(time.Now().Sub(img.Created))+" ago", HumanDuration(time.Now().Sub(img.Created))+" ago",
strings.Join(img.ParentCommand, " "), strings.Join(img.ContainerConfig.Cmd, " "),
) )
return nil return nil
}) })

View file

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

View file

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