[英]Run entire GitHub Actions workflow job in private docker container
I am trying to use the container
option in a GitHub Actions workflow to run the entire job in a docker container.我正在尝试在 GitHub 操作工作流中使用
container
选项来在 docker 容器中运行整个作业。 How do I specify the login credentials to retrieve this docker image from a private repository on docker hub?如何指定登录凭据以从 docker 集线器上的私有存储库中检索此 docker 映像?
jobs:
build:
runs-on: ubuntu-18.04
container: private_org/test-runner:1.0
I have successfully used the following docker-login
"action" to authenticate with docker hub as a "step", but this does not get performed until after the job-level container gets initialized.我已成功使用以下 docker
docker-login
“操作”来通过 docker 集线器作为“步骤”进行身份验证,但这直到作业级容器初始化后才会执行。
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: azure/docker-login@v1
with:
username: me
password: ${{ secrets.MY_DOCKERHUB_PASSWORD }}
- name: test docker creds
run: docker pull private_org/test-runner:1.0
This was implemented recently.这是最近实施的。 Use the following workflow definition:
使用以下工作流定义:
jobs:
build:
container:
image: private_org/test-runner:1.0
credentials:
username: me
password: ${{ secrets.MY_DOCKERHUB_PASSWORD }}
Source: https://github.blog/changelog/2020-09-24-github-actions-private-registry-support-for-job-and-service-containers/来源: https://github.blog/changelog/2020-09-24-github-actions-private-registry-support-for-job-and-service-containers/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.