def _check_image_exists_on_dockerhub(self, image_name: str) -> bool:
        """Check if a Docker image exists on DockerHub."""
        try:
            namespace, repo_tag = image_name.split("/")
            repo, tag = repo_tag.split(":")
        except ValueError:
            raise ValueError(f"Invalid image name format: {image_name}. Expected format: namespace/repo:tag")

        url = f"https://hub.docker.com/v2/repositories/{namespace}/{repo}/tags/{tag}"
        response = requests.get(url)
        return response.status_code == 200
Check if a Docker image exists on DockerHub.
tests/compatibility_tests/docker_manager.py