GitHub Repo service needs to pull a private docker image

elskwidPRO

a year 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

a year 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

a year 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?


a year 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

a year ago

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


a year ago

how would you authenticate that kind of thing locally?


elskwidPRO

a year 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

a year ago

We use docker login to authenticate locally.


a year ago

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


elskwidPRO

a year ago

Adding our credentials where, @Brody?


a year ago

check fragly's screenshot


elskwidPRO

a year ago

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


a year ago

ah gotcha


a year 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

a year 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.


a year ago

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


elskwidPRO

a year 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

a year ago

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


GitHub Repo service needs to pull a private docker image - Railway Help Station