【发布时间】:2022-01-27 02:47:48
【问题描述】:
我有以下 Github Actions 脚本,我在这里使用的 JSON 密钥文件对 GCP 项目具有所有者权限。我无法将图像推送到 GCP 工件 docker repo。
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0.4.3
with:
project_id: something-dev-tooling
credentials_json: '${{ secrets.GCP_JSON }}'
- name: Configure GCloud Auth provider with Docker
run: |
gcloud auth configure-docker australia-southeast1-docker.pkg.dev
- name: Build Tag & Push Container
run: |
tagname="${{github.ref_name}}"
docker build -t test-signup-api --target prod .
docker tag test-signup-api australia-southeast1-docker.pkg.dev/something-docker/test-signup-api:$tagname
docker push australia-southeast1-docker.pkg.dev/something-docker/test-signup-api:$tagname
这会产生以下错误:
成功标记 test-signup-api:latest 推送指 存储库 [澳大利亚-southeast1-docker.pkg.dev/something-docker/test-signup-api] 123f04c654be:准备 1d4281763c85:准备 4251fe09055f: 准备 a057xxef5483:准备 c6323d11ce20:准备 b4c1ae489097:准备 07d2d7aa362e:准备 7c1610cf2397: 准备 16427a3bb904:准备 449a28044116:准备 f11bbd657c82:准备 b4c1ae489097:等待 07d2d7aa362e:等待 7c1610cf2397:等待 16427a3bb904:等待 449a28044116:等待 f11bbd657c82:等待被拒绝:权限 “artifactregistry.repositories.downloadArtifacts”资源被拒绝 “项目/something-docker/locations/australia-southeast1/repositories/test-signup-api” (或者它可能不存在)
谁能帮忙?
【问题讨论】:
标签: docker google-cloud-platform github-actions