【问题标题】:Why GitHub action fails to push the docker image?为什么 GitHub action 无法推送 docker 镜像?
【发布时间】:2021-12-03 16:10:52
【问题描述】:

我有很多 GitHub 操作将构建的 docker 图像推送到 GitHub Container Repository

基本上,我所做的是在我的工作中有两个步骤:

      - name: Log in to GitHub Container Repository
        run: |
          echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
          
      - name: Push the image
        run: |
          docker push ghcr.io/organization_name_here/repository_name_here:latest

这适用于我所有的组织和存储库。

但是,对于一个非常特殊的存储库,我收到此错误:

Run docker push ghcr.io/organization_name_here/repository_name_here:latest
The push refers to repository [ghcr.io/holismreact/webrtc]
e6ff916ab651: Preparing
9d5288bc1c41: Preparing
bf5ee69d004a: Preparing
20e664c3d99e: Preparing
b3031b5001d5: Preparing
a303372b2caa: Preparing
39982b2a789a: Preparing
a303372b2caa: Waiting
39982b2a789a: Waiting
denied: permission_denied: write_package
Error: Process completed with exit code 1.

我该如何解决这个问题?

【问题讨论】:

    标签: docker github github-actions ghcr github-container-registry


    【解决方案1】:

    这对我也不起作用。

    解决方法是使用组织中一位用户的 GitHub 个人访问令牌 (PAT)。

    echo "${{ secrets.DAVE_PERSONAL_ACCESS_TOKEN }}" | docker login ghcr.io -u DaveTheDeveloper --password-stdin
    

    有一个许可 OrganizationPackages: write 的耳语,但对我来说不存在。

    【讨论】:

      猜你喜欢
      • 2021-11-22
      • 2021-09-30
      • 2022-01-27
      • 2022-11-25
      • 2020-09-26
      • 2012-09-03
      • 2021-02-13
      • 2021-02-27
      • 2020-04-06
      相关资源
      最近更新 更多