Skip to main content

ImageChecker

No overview available.

Methods


image_exists()

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

Checks if a specified container image exists in a repository for a given tag and architecture. Callers use this to verify the presence of an image before attempting to pull or use it.

Parameters

NameTypeDescription
repositorystrThe name of the image repository to check (e.g., 'library/ubuntu').
tagstrThe specific tag of the image to check (e.g., 'latest', '20.04').
archTuple[Architecture, ...] = ("linux/amd64",)A tuple of architecture strings (e.g., 'linux/amd64', 'linux/arm64') to check for the image. The method will return true if the image exists for any of the provided architectures.

Returns

TypeDescription
Optional[str]Returns the digest of the image if it exists, otherwise returns None.