1616a09b61
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>
26 lines
764 B
Go
26 lines
764 B
Go
package platforms
|
|
|
|
import (
|
|
cplatforms "github.com/containerd/containerd/platforms"
|
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
|
)
|
|
|
|
type allPlatformsWithPreferenceMatcher struct {
|
|
preferred cplatforms.MatchComparer
|
|
}
|
|
|
|
// AllPlatformsWithPreference will return a platform matcher that matches all
|
|
// platforms but will order platforms matching the preferred matcher first.
|
|
func AllPlatformsWithPreference(preferred cplatforms.MatchComparer) cplatforms.MatchComparer {
|
|
return allPlatformsWithPreferenceMatcher{
|
|
preferred: preferred,
|
|
}
|
|
}
|
|
|
|
func (c allPlatformsWithPreferenceMatcher) Match(_ ocispec.Platform) bool {
|
|
return true
|
|
}
|
|
|
|
func (c allPlatformsWithPreferenceMatcher) Less(p1, p2 ocispec.Platform) bool {
|
|
return c.preferred.Less(p1, p2)
|
|
}
|