mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 05:31:47 +00:00
Implemented checksum computation on image creation (necessary for new push primitive)
This commit is contained in:
@@ -98,11 +98,13 @@ func (graph *Graph) Create(layerData Archive, container *Container, comment, aut
|
||||
img.Parent = container.Image
|
||||
img.Container = container.Id
|
||||
img.ContainerConfig = *container.Config
|
||||
if config == nil {
|
||||
if parentImage, err := graph.Get(container.Image); err == nil && parentImage != nil {
|
||||
img.Config = parentImage.Config
|
||||
}
|
||||
// FIXME: If an image is pulled from a raw URL (not created from a container),
|
||||
// its checksum will not be computed, which will cause a push to fail
|
||||
checksum, err := container.RwChecksum()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
img.Checksum = checksum
|
||||
}
|
||||
if err := graph.Register(layerData, img); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user