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:
Paweł Gronowski
2024-11-08 12:09:15 +01:00
parent 0020c41e3a
commit 44ed3067ca
7 changed files with 112 additions and 5 deletions

View File

@@ -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
}