R
Railway15mo ago
IgnisDa

How to re-deploy a docker image source?

I deployed a service via docker image (https://docs.railway.app/develop/services#service-source). Now when I call railway up in my github actions (with the RAILWAY_TOKEN set to that service's token), it does not deploy the docker images but instead tries to build my project using nixpacks. How can I instruct Railway to download the latest docker image and deploy it?
Railway Docs
Services | Railway Docs
Documentation for Railway
25 Replies
Percy
Percy15mo ago
Project ID: 16582eee-f963-4f76-a699-aa37b8edbec1
IgnisDa
IgnisDaOP15mo ago
16582eee-f963-4f76-a699-aa37b8edbec1
Brody
Brody15mo ago
railway up is used to deploy your local project and has nothing to do with docker images what docker image did you use
IgnisDa
IgnisDaOP15mo ago
GitHub
Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 330 million projects.
IgnisDa
IgnisDaOP15mo ago
Its from my project
Brody
Brody15mo ago
then just use the latest tag ghcr.io/ignisda/ryot:latest
IgnisDa
IgnisDaOP15mo ago
how would railway know when I release a new image? and will it deploy it then?
Brody
Brody15mo ago
they dont, you have to go and click redeploy in the 3 dot menu
IgnisDa
IgnisDaOP15mo ago
thats a shame. does the public API have anything that can help me automate this? i think it does
Brody
Brody15mo ago
yes it does, you would want to setup a github action to call their public graphql api
IgnisDa
IgnisDaOP15mo ago
how about caching? Will the image be cached on the Railway builders and when I redeploy, the existing image will be used instead of pulling the latest image. Anything I can do to prevent that?
Brody
Brody15mo ago
if you redeploy the same image, yes the layers do get cached, if you deploy an entirely new image, no cache
IgnisDa
IgnisDaOP15mo ago
well ghcr.io/ignisda/ryot:latest is technically the same image, right? Atleast thats what is docker's default behavior. is there a env variable that instructs railway to not use docker caching mechanism?
Brody
Brody15mo ago
there is not as v2.18.7, yes for now since that is the latest tag
IgnisDa
IgnisDaOP15mo ago
of what?
Brody
Brody15mo ago
your image
IgnisDa
IgnisDaOP15mo ago
my latest image is tagged both v2.18.7 and latest.
Brody
Brody15mo ago
correct
IgnisDa
IgnisDaOP15mo ago
now lets say I release v2.18.8 (and a latest to go along with it). How would railway know to not re-use the existing cache?
Brody
Brody15mo ago
because it's a different image different sha hashes
IgnisDa
IgnisDaOP15mo ago
there used to be one back when I used railway almost 1.5 years ago. I think it was DOCKER_CACHE=0.
Brody
Brody15mo ago
interesting
IgnisDa
IgnisDaOP15mo ago
thats not how docker works. if you already have a ghcr.io/ignisda/ryot:latest on your machine, it does not check for SHA, just assumes it is the latest (even though it is not and there exists a newer image on the registry).
Brody
Brody15mo ago
bruh
IgnisDa
IgnisDaOP15mo ago
I also think it was added specifically for me since I was in a similar situation back then. The fact they have removed it means theres a better solution in place. the docs don't mention anything though.
Want results from more Discord servers?
Add your server