I want to have a services section for Github Actions workflow file with a private registry. The simplified config looks like this:
jobs:
my_job:
runs-on: ubuntu-latest
services:
image-name:
image: docker.pkg.github.com/<org>/<repo>/<image>
steps:
# ...
The repo resides within the same organization, if it matters. Also the image can be pulled with a proper credentials locally, but obviously fails at github actions pipeline with an error:
Error response from daemon: Get <image_url>: no basic auth credentials
So my question is: is it possible to specify credentials either via env vars (aka Secrets in Github), or maybe some flag for services.options exists? I believe this can be an alternative with manual login/pulling/starting, but I would prefer declarative way.
Since Sept. 24th 2020, yes, it should be possible to specify your credentials for a private registry.
See "GitHub Actions: Private registry support for job and service containers"
You can now use images from private registeries in job and service containers.
Here's an example of using private images from Docker Hub:
jobs:
build:
container:
image: octocat/ci-image:latest
credentials:
username: mona
password: ${{ secrets.docker_hub_password}}
services:
db:
image: octocat/testdb:latest
credentials:
username: mona
password: ${{ secrets.docker_hub_password }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With