You can now use images from private registries in job and service containers

Hi Friends, passing on some news from our changelog :space_invader:

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:

jobs:
  build:
    container:
      image: octocat/ci-image:latest
      credentials:
        username: mona
        password: ${{ secrets.docker_hub_password}}
    services:
      db:
        image:  ghcr.io/octocat/testdb:latest
        credentials:
          username: ${{ github.repository_owner }}
          password: ${{ secrets.ghcr_password }}
1 Like

For more information, please check out our help article About scopes and permissions for GitHub Container Registry.

1 Like