Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker registry aliases not available inside cache_from/cache_to inside macro #21082

Open
sureshjoshi opened this issue Jun 18, 2024 · 0 comments
Labels

Comments

@sureshjoshi
Copy link
Member

sureshjoshi commented Jun 18, 2024

[docker.registries.ghcr]
address = "ghcr.io/robotpajamas"
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:

ERROR: failed to solve: failed to configure registry cache exporter: invalid reference format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant