GitHub Repo service needs to pull a private docker image

elskwidPRO

10 months ago

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!

0 Replies

10 months ago

assuming you're on pro plan, you'll have the option to add private image credentials in your service settings like shown here:

1252340051996835800


elskwidPRO

10 months ago

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?


10 months ago

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


elskwidPRO

10 months ago

Yeah, it's an odd case. I appreciate the answer, though!


10 months ago

how would you authenticate that kind of thing locally?


elskwidPRO

10 months ago

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.


elskwidPRO

10 months ago

We use docker login to authenticate locally.


10 months ago

have you tried adding your docker credentials there? it couldn't hurt


elskwidPRO

10 months ago

Adding our credentials where, @Brody?


10 months ago

check fragly's screenshot


elskwidPRO

10 months ago

That option is not available for a service that uses a GitHub repo as the source.


10 months ago

ah gotcha


10 months ago

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


elskwidPRO

10 months ago

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.


10 months ago

you just wont get that kind of low level control that would allow you to run docker login


elskwidPRO

10 months ago

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/usingdockerimages.html#determine-your-dockerauthconfig-data


elskwidPRO

10 months ago

And we'd like to do this for branch deploys as well, which complicates things a bit.