Support pulling docker images from docker.pkg.github.com

I use docker images for my builds and would like to pull from docker.pkg.github.com instead of docker hub. I’m guessing this would require additional permissions for the travis github app/integration - maybe it could be optional? I’d be fine allowing pkg read access to travis.

In the meantime, does anyone know of workaround using auth tokens / env vars to make it possible to pull docker images from github?

I believe Docker already supports that:

docker pull 3rd-party-registry.address[:port]/repositoryname

I personally have been successfully using quay.io.

If you have something else in mind, please specify it in more details (e.g. give an example of your vision).

I’ve been getting this error:

docker pull docker.pkg.github.com/mygroup/myrepo/my-docker-image:mytag
Error response from daemon: Get https://docker.pkg.github.com/v2/mygroup/myrepo/my-docker-image/manifests/mytag: no basic auth credentials

So, it seems like github package repos might require authentication in order to pull, so I guess I’m wondering the best way to do that given that travis already does some level of auth in order to get notified of various repo events.

The 1st link in Google on “docker pull authentication” leads to

How would you suggest providing login credentials? Secure env vars won’t work because we require PRs from forks as our submission model: https://docs.travis-ci.com/user/pull-requests#pull-requests-and-security-restrictions. All PRs would fail in this case.

Then you need to make the image(s) required for PRs publicly available without login or with some openly published “guest login” credentials (which is essentially the same).

1 Like