gpt4 book ai didi

docker - 创建引用 Github 包上的图像的 Github Docker 容器操作

转载 作者:行者123 更新时间:2023-12-02 19:20:42 24 4
gpt4 key购买 nike

是否可以从存储在 Github Packages 上的 docker 图像创建 github 操作?
action.yml :

runs:
using: 'docker'
image: 'docker://docker.pkg.github.com/<you>/<your-repo>/<image>:<version>'

目前似乎无法提供 docker 基本身份验证凭据。

错误信息:
  Pull down action image '[...] '
/usr/bin/docker pull [...]
Error response from daemon: Get https://[...]: no basic auth credentials
##[warning]Docker pull failed with exit code 1, back off 9.515 seconds before retry.
/usr/bin/docker pull [...]
Error response from daemon: Get [...]: no basic auth credentials
##[warning]Docker pull failed with exit code 1, back off 2.011 seconds before retry.
/usr/bin/docker pull [...]
Error response from daemon: Get [...]: no basic auth credentials
##[error]Docker pull failed with exit code 1

最佳答案

抱歉耽误了这件事!

我已经获得了 GitHub 支持,显然我在这里尝试做的事情是不可能的 ,但很快就会到。我在这里加入了 Github 开发人员支持的部分响应:

Thanks for writing back to clarify! For the image attribute in a workflow file, it's not possible to specify a Docker image hosted in GitHub Packages the same way you could a cached container image or an image hosted on Docker Hub. Given this example workflow file snippet, there isn't a way to specify authorization credentials in the workflow file



这是因为目前从 GitHub Packages 安装包需要身份验证。无论是来自您的 CI 还是您的本地机器,当从 Github 包中获取人工制品时,您都需要进行身份验证。公共(public)存储库仍然如此。

最后

As a workaround, you could use GitHub Actions to publish your package to both Docker Hub and GitHub Packages. If you want to use that package in a GitHub Actions workflow, like for a service or to run the workflow in a container, you could reference its Docker Hub URL.



例如,我已将这些建议应用于 GitHub Action schema-validation

关于docker - 创建引用 Github 包上的图像的 Github Docker 容器操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60048082/

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