mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
c8d/container/inspect: Return ImageManifestDescriptor
`ImageManifestDescriptor` will contain an OCI descriptor of platform-specific manifest of the image that was picked when creating the container. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -77,11 +77,21 @@ func (daemon *Daemon) ContainerInspect(ctx context.Context, name string, options
|
||||
base.SizeRootFs = &sizeRootFs
|
||||
}
|
||||
|
||||
imageManifest := ctr.ImageManifest
|
||||
if imageManifest != nil && imageManifest.Platform == nil {
|
||||
// Copy the image manifest to avoid mutating the original
|
||||
c := *imageManifest
|
||||
imageManifest = &c
|
||||
|
||||
imageManifest.Platform = &ctr.ImagePlatform
|
||||
}
|
||||
|
||||
return &containertypes.InspectResponse{
|
||||
ContainerJSONBase: base,
|
||||
Mounts: mountPoints,
|
||||
Config: ctr.Config,
|
||||
NetworkSettings: networkSettings,
|
||||
ContainerJSONBase: base,
|
||||
Mounts: mountPoints,
|
||||
Config: ctr.Config,
|
||||
NetworkSettings: networkSettings,
|
||||
ImageManifestDescriptor: imageManifest,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user