You can now use images from private registries in job and service containers #25478
-
Hi Friends, passing on some news from our changelog 👾 Job and Service containers in GitHub Actions allow you to containerize your CI environment and make databases, caches, or other services available to your tests. Previously those containers had to come from a public container registry which limited the usefulness for some customers. Additionally, we had numerous requests from the GitHub community forums for private registry support. Here’s an example of using private images from Docker Hub and GitHub Container Registry:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
For more information, please check out our help article About scopes and permissions for GitHub Container Registry. |
Beta Was this translation helpful? Give feedback.
-
I'm quite late to the party, and have struggled with trying to use a private container in the same organization as a service image. Many docs mention https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-of-jobsjob_idservicesservice_idcredentials uses completely different credentials. I ultimately needed the following: jobs:
foo:
runs-on: ubuntu-latest
# Permissions are crucial!
permissions:
contents: read
packages: read
services:
postgres:
image: ghcr.io/${{ github.repository_owner }}/postgres:15
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }} |
Beta Was this translation helpful? Give feedback.
For more information, please check out our help article About scopes and permissions for GitHub Container Registry.