Skip to main content

ImageChecker

This class defines a protocol for checking the existence of container images within a specified repository. It provides an asynchronous interface to verify image availability based on repository name, tag, and target architectures.

Methods​


image_exists()​

@classmethod
def image_exists(
repository: str,
tag: str,
arch: Tuple[Architecture, ...] = ("linux/amd64",)
) -> Optional[str]

Checks for the existence of a container image in a remote registry for specific hardware architectures.

Parameters​

NameTypeDescription
repositorystrThe full name of the image repository to check (e.g., 'library/ubuntu').
tagstrThe specific version or tag of the image to look for.
archTuple[Architecture, ...] = ("linux/amd64",)A tuple of target CPU architectures to validate against the registry manifest.

Returns​

TypeDescription
Optional[str]The digest of the image if found, or None if the image does not exist for the specified repository, tag, and architecture.