Connect service to private dockerhub repo

tfdev
TRIAL

2 years ago

I have a private dockerhub repo that I want to use the image from in my railway app

However I cannot seem to find anyway to add connection or login credentials to enable railway to pull the image.

Is this possible?
Thanks

Solved

12 Replies

2 years ago

unfortunately at this time railway does not support pulling private images from the supported registries.

do you think you could share why you opted to build your own image vs. giving railway your github repo and Dockerfile and letting them build and run the resulting image?


tfdev
TRIAL

2 years ago

I can alternatively build from the repository. The reasoning behind the decision was to enable me to supply the env variables within different dockerfiles for different environment configurations. Therefore I cannot use a public dockerhub repo.
I'll just have to alter my setup and supply the env variables to the container through other means.

Thank you for clarifying this, though I believe that it may be a useful future feature to allow pulling private dockerhub repositories.


2 years ago

yes for sure, support for deploying private images is definitely planned, though I don't have a timeline on that.

as for the alterations, could you have something like "Dockerfile.prod" or "Dockerfile.dev" and then set a service variable "RAILWAYDOCKERFILEPATH" to the name of the dockerfile you'd like railway to build from, while specifying the needed variables in your service variables.


tfdev
TRIAL

2 years ago

Yeah that should work. Thanks for responding.


2 years ago

happy to help!


obstkompost
PRO

a year ago

Hello everyone,
I would also think it would be great if this feature were implemented. I have my images under GitHub Packages
and would prefer to use them from there and not have them built by Railway.


a year ago

would you mind sharing why you would prefer github build the image instead of railway?


obstkompost
PRO

a year ago

I would like to explain why I prefer the github build:
If I build the image on Github and just deploy the built image on Railway, in my opinion this reduces the risk of my source code being leaked. Since Github has my source code anyway, it makes little difference in terms of security if they
also build the image. However, if an external service provider needs access to the source code repo, this of course increases the risk of leaks


a year ago

That makes sense, thank you for sharing!


zbrot
PRO

a year ago

Hey there, I'm in the same boat. I discovered your service a few days ago and really like. But I would need to be able to deploy a private docker image in order to move to your service. Thanks.


obstkompost
PRO

a year ago

You can now with the Pro-Plan (:


Status changed to Solved Railway over 1 year ago


zbrot
PRO

a year ago

That's awesome! Checking this out now


Connect service to private dockerhub repo - Railway Help Station