Login inside a github action

Hi! I am building a github action that uses a docker image. To download that image, it requires authentication.

I have tried to do a docker login in the wf before calling that action, but i am still receiving an unauthorised error. Any idea what should i do? Should i do the authentication inside the action itself?

My action has this inside:

runs:
using: ‘docker’
image: ‘docker://myproject/miimage:latest’
args:

How should i do the authentication?

Thanks

I don’t think you can, the only options described in the documentation are using a Dockerfile in your repository, or using a public image:

Thats a big limitation… is there any way to make it work with the pre tag? It is, do a docker login with a PAT sent as input? Would it work?

pre-entrypoint uses the same image, so I’m pretty sure it won’t. I also just noticed the runs.image documentation explicitly says:

The value can be the Docker base image name, a local Dockerfile in your repository, or a public image in Docker Hub or another registry.

Which makes it pretty clear that private images are not supported.

Thanks. Do you know what is the best way to ask github if this will be supported? Do they usually answer here or do i need to raise an issue to any git where they manage new features?

There are some Github people around here, so I hope they’ll see it. I don’t see any obvious category for feature requests on the contact page.

2 Likes