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:
parent
b809dc4271
commit
0146c80c40
3 changed files with 5 additions and 5 deletions
|
@ -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
|
||||||
})
|
})
|
||||||
|
|
4
graph.go
4
graph.go
|
@ -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
|
||||||
|
|
4
image.go
4
image.go
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue