from typing import Optional


def is_google_registry_domain(domain: Optional[str]) -> bool:
    """Returns true if the given Docker image path points to either the Google
    Container Registry or the Artifact Registry."""
    if domain is None:
        return False
    return domain == 'gcr.io' or domain.endswith('docker.pkg.dev')