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
| Name | Type | Description |
|---|---|---|
| repository | str | The full name of the image repository to check (e.g., 'library/ubuntu'). |
| tag | str | The specific version or tag of the image to look for. |
| arch | Tuple[Architecture, ...] = ("linux/amd64",) | A tuple of target CPU architectures to validate against the registry manifest. |
Returns
| Type | Description |
|---|---|
Optional[str] | The digest of the image if found, or None if the image does not exist for the specified repository, tag, and architecture. |