GitHub Repo service needs to pull a private docker image
Hi Folks,
We have a project using a GitHub Repo service. That repo has a
Dockerfile
that pulls a private image in the FROM
instruction. Some posts here mention Docker authentication working for a Docker Image service, but we don't see that option in our service. Is there a way for us to get our application deployed?
Project ID: 1540c21e-5c98-459e-a701-faf38362495a
Thanks!16 Replies
Project ID:
1540c21e-5c98-459e-a701-faf38362495a
assuming you're on pro plan, you'll have the option to add private image credentials in your service settings like shown here:
Hi @Fragly, thanks. The thing is, our service uses a GitHub repository as the source, so the registry credentials option is not present. We're building an image from a
Dockerfile
that uses a private image as its base. Does that make sense?ooh, i see! Sorry for my misunderstanding 🙏
I'm not really sure how you'd authenticate the private image in that case
Someone else might have an idea though
Yeah, it's an odd case. I appreciate the answer, though!
how would you authenticate that kind of thing locally?
There are options, of course: we could (1) make our image public (we don't really want to do that since we may end up with our code in that image), (2) use GiHub or some other service to build the image, then use that image as our source on Railway.
For now, we would like the convenience of using the Railway Docker build since it will save us some time.
We use
docker login
to authenticate locally.have you tried adding your docker credentials there? it couldn't hurt
Adding our credentials where, @Brody?
check fragly's screenshot
That option is not available for a service that uses a GitHub repo as the source.
ah gotcha
then number 2 is going to be the best option, you already have a Dockerfile so adding an action to build it on push to main or during a release would be trivial
It's likely the way we'll have to do it, but I was hoping to get a little Railway assistance at this point. We're assessing multiple PaaS deployments to understand the edge cases and opportunities.
you just wont get that kind of low level control that would allow you to run docker login
Yeah. I like the way GitLab has the option to provide Docker credentials to a CI/CD runner. That could be an interesting option.
https://docs.gitlab.com/ee/ci/docker/using_docker_images.html#determine-your-docker_auth_config-data
And we'd like to do this for branch deploys as well, which complicates things a bit.