如何在 github actions 中的作业之间共享 docker 镜像

gam*_*r17 7 github-actions

我最近转向了 GitHub Action。尝试了几天,但可以找到合适的解决方案。

在此输入图像描述

  • JOB1我正在构建Image A并使用Image A作为基础图像来构建Image B.
  • 现在Image B将充当Image C在 JOB2 和Image DJob3 中构建的基础映像。

我已经尝试过这两种解决方案,但它们不起作用。

  1. https://github.com/docker/build-push-action/issues/225#issuecomment-727639184
  2. https://evilmartians.com/chronicles/build-images-on-github-actions-with-docker-layer-caching

尝试上述解决方案时遇到的一些错误:

Error: buildx failed with: error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed
Run Code Online (Sandbox Code Playgroud)