Deploying with docker gives "Cache mounts MUST be in the format --mount=type=cache,id=<cache-id>"
This works when I deploy these dockerfiles on an ecs container (via ecr)
I don't really need to use Docker on railway, but i would prefer not to remove / rename these dockerfiles, so if possible can you disable autodetecting Docker?
Solution:Jump to solution
You would need to either remove or rename them, or update your dockerfile accordingly
42 Replies
Project ID:
32495aae-4b01-4a90-badf-1d53d394b8cd
32495aae-4b01-4a90-badf-1d53d394b8cd
Solution
You would need to either remove or rename them, or update your dockerfile accordingly
do you know why these docker files don't work on railway but they work on ECS?
because the cache mounts must be in the format --mount=type=cache,id=s/<serviceId>
yeah but why?
that's how railway expects them
is this documented somewhere
ok, if i set a railwy config, will that supersede wahtever is automatically selecting this Dockerfile?
there is no way to disable the auto detection of the Dockerfile
they would need to be moved elsewhere, renamed, or removed
yeah, don't really want to change our prod setup just to see if railway works for us :/
you could always create a branch that has the applicable changes on the Dockerfile for testing on Railway
yeah i just think the named Dockerfile would ideally be where our production build lives. Feels like there should be a way to turn this off
do you see anything wrong with this part of the dockerfile vs what railway is expecting?
i am still getting the same error
is that your service id?
i think so, i copied it from the dashboard
you mean the URL?
no, i did the command + k instructions from the docs you sent
this
do you have other cache mounts in the dockerfile?
bind mounts
bind mounts are not supported
I don't think that's mentioned in the docs
guess i should just drop these
yep
Looks like I can set the railway dockerfile path successfully to something else, which also works for us but is annoying to have to maintain multiple dockerfiles e.g. these cache mounts make it faster to do installs, etc, especially for dev
yep but afaik you can't set it to something that doesn't exist and have it skip using a dockerfile
correct, but i needed to fork my dockerfile anyways to support railway's more limited functionality
so I just set it to Dockerfile.railway
perfect
i think i'm close but one of my docker images is giving me an error here that i'm not getting in prod - i'm not sure why this could happen - thought that was the whole point of docker 😂
have you seen anything like this? did some searching, but haven't found a solution
alternatively is there an easy way for me to ssh into the box / understand what's inside the built version of this container besides adding echo statements?
havent seen this error before, and theres no ssh.
are you using nixpacks or a dockerfile right now?
dockerfile
forgive me for asking, but how have you confirmed that?
also from the build logs
sounds good to me, but yeah unfortunately I haven't seen that issue before, are you able to build and run this locally with buildkit
hmm, yeah - tho our setup in prod is moreso what i'm trying to mirror
Here's our github action for pushing this image, incase anything looks like we're doing something incompatible with railway
it's worth noting that we're setting the target to prod - is that possible on railway? if not, I think it will default to this target anyways.
this is building and pushing an image, I'm not sure what it has to do with railway because you are not deploying your railway service from an image
What is your dockerfile builder doing?
fwiw, I don't work for railway.
their builder is building and publishing an image but I'm not sure the relevance of the action you showed
Got it- that clarifies a lot. The flair is a bit confusing (lol what is a conductor)
This is the action we’re using to build and push this image we’re deploying to prod where it works. Kinda why I’d expect railway to just work on this but ehh guess I should just find an alternative
a conductor is railway's term for moderator.
I'm sure this issue is just a simple misconfiguration somewhere that's being overlooked