diff options
author | Nicolas De Loof <nicolas.deloof@gmail.com> | 2022-07-06 14:24:38 +0200 |
---|---|---|
committer | Djordje Lukic <djordje.lukic@docker.com> | 2023-01-05 16:20:41 +0100 |
commit | 1616a09b613b07e56926ae23b1ae710f9a2c64fe (patch) | |
tree | 911d86924ae4e9de2be5db9c46cb8bf07e822345 /image | |
parent | 3e39ec60dab859f70577ea8561fe5bda5236749e (diff) | |
download | docker-1616a09b613b07e56926ae23b1ae710f9a2c64fe.tar.gz |
add support for image inspect with containerd-integration
This is a squashed version of various PRs (or related code-changes)
to implement image inspect with the containerd-integration;
- add support for image inspect
- introduce GetImageOpts to manage image inspect data in backend
- GetImage to return image tags with details
- list images matching digest to discover all tags
- Add ExposedPorts and Volumes to the image returned
- Refactor resolving/getting images
- Return the image ID on inspect
- consider digest and ignore tag when both are set
- docker run --platform
Signed-off-by: Djordje Lukic <djordje.lukic@docker.com>
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'image')
-rw-r--r-- | image/image.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/image/image.go b/image/image.go index 25179a1c8a..af9563eeee 100644 --- a/image/image.go +++ b/image/image.go @@ -9,6 +9,7 @@ import ( "strings" "time" + "github.com/docker/distribution/reference" "github.com/docker/docker/api/types/container" "github.com/docker/docker/dockerversion" "github.com/docker/docker/layer" @@ -119,6 +120,7 @@ type Image struct { // Details provides additional image data type Details struct { + References []reference.Named Size int64 Metadata map[string]string Driver string @@ -199,6 +201,13 @@ type ChildConfig struct { Config *container.Config } +// NewImage creates a new image with the given ID +func NewImage(id ID) *Image { + return &Image{ + computedID: id, + } +} + // NewChildImage creates a new Image as a child of this image. func NewChildImage(img *Image, child ChildConfig, os string) *Image { isEmptyLayer := layer.IsEmpty(child.DiffID) |