gitlab私有存储库将在CI/CD变量中包括多个auth令牌

发布于 2025-02-05 15:18:34 字数 740 浏览 2 评论 0原文

参考 gitlab文档

我可以使用一种配置来访问一个配置私人Docker Image Repo。

{
    "auths": {
        "registry.example.com:5000": {
            "auth": "base64.... token"
        }
    }
}

这将设置为DOCKER_AUTH_CONFIG变量,但是CI/CD的阶段可以访问具有不同的auth令牌的两个不同的私人docker存储库。

是否可以包含一个以上的身份令牌,如下

{
    "auths": {
        "registry1.com:5000": {
            "auth": "base64.... token 1"
        },
        {
        "registry2.com:5000": {
            "auth": "base64.... token 2"
        }
    }
}

With reference to the Gitlab document

I can use one configuration to access on private docker image repo.

{
    "auths": {
        "registry.example.com:5000": {
            "auth": "base64.... token"
        }
    }
}

this is set to DOCKER_AUTH_CONFIG variable, but the CI/CD has a stage which access two different private Docker repo, which have different Auth token.

Is it possible to include more than one auth token, like below

{
    "auths": {
        "registry1.com:5000": {
            "auth": "base64.... token 1"
        },
        {
        "registry2.com:5000": {
            "auth": "base64.... token 2"
        }
    }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

街道布景 2025-02-12 15:18:36

是的,它完全可以。如文档

您可以根据需要为任意多的注册表添加配置,如上所述,将更多的注册表添加到“ auths”哈希。

Yes, it works exactly like that. As stated in the documentation:

You can add configuration for as many registries as you want, adding more registries to the "auths" hash as described above.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文