R
Railway14mo 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
Percy14mo ago
Project ID: 16582eee-f963-4f76-a699-aa37b8edbec1
IgnisDa
IgnisDa14mo ago
16582eee-f963-4f76-a699-aa37b8edbec1
Brody
Brody14mo 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
IgnisDa14mo 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
IgnisDa14mo ago
Its from my project
Brody
Brody14mo ago
then just use the latest tag ghcr.io/ignisda/ryot:latest
IgnisDa
IgnisDa14mo ago
how would railway know when I release a new image? and will it deploy it then?
Brody
Brody14mo ago
they dont, you have to go and click redeploy in the 3 dot menu
IgnisDa
IgnisDa14mo ago
thats a shame. does the public API have anything that can help me automate this? i think it does
Brody
Brody14mo ago
yes it does, you would want to setup a github action to call their public graphql api
IgnisDa
IgnisDa14mo 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
Brody14mo ago
if you redeploy the same image, yes the layers do get cached, if you deploy an entirely new image, no cache
IgnisDa
IgnisDa14mo 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
Brody14mo ago
there is not as v2.18.7, yes for now since that is the latest tag
IgnisDa
IgnisDa14mo ago
of what?
Brody
Brody14mo ago
your image
IgnisDa
IgnisDa14mo ago
my latest image is tagged both v2.18.7 and latest.
Brody
Brody14mo ago
correct
IgnisDa
IgnisDa14mo 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
Brody14mo ago
because it's a different image different sha hashes
IgnisDa
IgnisDa14mo ago
there used to be one back when I used railway almost 1.5 years ago. I think it was DOCKER_CACHE=0.
Brody
Brody14mo ago
interesting
IgnisDa
IgnisDa14mo 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
Brody14mo ago
bruh
IgnisDa
IgnisDa14mo 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