<#21082 Docker registry aliases not available insi...
# github-notifications
c
#21082 Docker registry aliases not available inside `cache_from`/`cache_to` inside macro Issue created by sureshjoshi
Copy code
[docker.registries.ghcr]
address = "<http://ghcr.io/robotpajamas|ghcr.io/robotpajamas>"
Copy code
def docker_image_ghcr(name: str, **kwargs) -> None:
    REPO_NAME = "Dockerfiles"

    cache_from = kwargs.pop(
        "cache_from",
        {
            "type": "registry",
            "ref": f"@ghcr/{REPO_NAME}/{name}/build-cache:main",
        },
    )
    cache_to = kwargs.pop(
        "cache_to",
        {
            "type": "registry",
            "mode": "max",
            "ref": f"@ghcr/{REPO_NAME}/{name}/build-cache:main",
        },
    )

    docker_image(  # noqa: F821
        name=f"{name}-ghcr",
        cache_from=cache_from,
        cache_to=cache_to,
        **kwargs,
    )
Leads to an error:
Copy code
ERROR: failed to solve: failed to configure registry cache exporter: invalid reference format
pantsbuild/pants