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
| Name | Type | Description |
|---|---|---|
| repository | str | The name of the image repository to check (e.g., 'library/ubuntu'). |
| tag | str | The specific tag of the image to check (e.g., 'latest', '20.04'). |
| arch | Tuple[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
| Type | Description |
|---|---|
Optional[str] | Returns the digest of the image if it exists, otherwise returns None. |