Rust - ERROR [stage-0 3/9] COPY .nixpacks/nixpkgs...
We have successfully managed to run our Rust service locally, and it builds properly on CI in GitHub. However, we recently started using Railway and are facing an error in the deployment. I have tried running 'nixpacks build .' on my local machine but it fails with a similar error. In an attempt to understand what's going on, I added a dummy 'nixpacks.toml' file to the project's root, but it doesn't seem to be getting picked up.
Can I get some help to understand what the problem is?
27 Replies
Project ID:
8811bf1a-27f3-48f9-9c58-440d79085151
Project ID:
8811bf1a-27f3-48f9-9c58-440d79085151
is that an AI generated nixpacks.toml?
yes, I have added that one after the errors and failures. I don't think it's being picked up
it's not being picked up because the syntax is completely wrong lmao
😄
never take what what an AI says at face value
take the time to manually read the docs, it will pay off
https://nixpacks.com/docs/configuration/file
show me your new nixpacks.toml?
stop deleting stuff lol
my bad
Alright, the file is being picked up but back to square one with the errors (attached)
Here is my file
have you read the documentation for nixpacks?
You mean the whole website or the link you shared?
If you can share a proper nixpacks.toml file that works for Rust that is really helpful
why do you need to use one in the first place?
I do not need to, I want to get our rust server code to build on Railway and get deployed
It's building and running fine locally and builds fine on Github. Railway uses NixPacks and that's where the errors are coming from
try disabling nixpacks cacheing
Is that something that I do on Railway?
What should be the value for that env var? I'm setting getting the same error with empty and true
Deployement ID if you can check 6760beb2-1a61-42d0-887b-c5dd0ee17010
it would be any value, i don't work for Railway so I can't check
Ah! Thanks for helping me!
I think it might be best for you to move to a Dockerfile based build
I do have a docker compose file that cobines a bunch of things, that's what we are using locally and on github
But NixPacks does not pick it up
you seem to have a good understanding of how rust apps are built and ran so throwing together a dockerfile should not be a problem for you
railway does not support docker compose files
Alright so from your knowledge with Railway can I point it to a dockerfile in the sub folders or it should be at root?
if you had your rust app in an /api subfolder for example, you would put the dockerfile in that subfolder and then point the services root directory to that subfolder, and then the dockerfile is automatically picked up
Thanks! I'll give that a shot, thanks for helping out lost folks
no problem 🙂
You also shouldn't need a nixpacks.toml file to build and deploy rust apps. You can try deleting the file and deploying