gpt4 book ai didi

google-container-registry - Bitbucket 管道 : pulling an image from GCR with environment variables fails

转载 作者:行者123 更新时间:2023-12-04 17:31:42 24 4
gpt4 key购买 nike

因此,我尝试使用我的 Google 容器注册表中的图像,因为这是我需要进行身份验证的私有(private)注册表。

显然我不想每小时更新我的​​身份验证 token 以使我的管道正常工作,所以我需要去获取 json key 文件。

当我按如下方式定义图像时,它会起作用:

image:
name: eu.gcr.io/project_id/image:latest
username: _json_key
password: >
{JSON file content}
email: pipelines@bitbucket.com

但这意味着您的 json key 文件已公开,可供所有有权访问管道的人查看,而不是我想要的。

然后我将 JSON 文件的内容放入环境变量中,并将实际的 json 替换为环境变量,如下所示:
image:
name: eu.gcr.io/project_id/image:latest
username: _json_key
password: >
${JSON_KEY}
email: pipelines@bitbucket.com

不知何故,在第二种情况下它不起作用:(

最佳答案

经过更多测试,我发现这有效:

image:
name: eu.gcr.io/project_id/image:latest
username: _json_key
password: '$JSON_KEY'

关于google-container-registry - Bitbucket 管道 : pulling an image from GCR with environment variables fails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42301510/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com