Closed affanshahid closed 1 year ago
This is quite bizzare, can you make a reproduction repo that triggers this? Don't really want to scaffold my own example around a single dockerfile.
Here is a small reproduction repo: https://github.com/affanshahid/prisma-rust-silent-exit-reproduction. I checked the error code after the exit and it seems it is a SEGFAULT (139).
Not sure why but I can't for the life of me get that example running. Have had to change x86_64
to aarch64
since I'm on M1 but I'm getting the following:
app_1 | exec /bin/prisma-rust-silent-exit-reproduction: no such file or directory
prisma-rust-silent-exit-reproduction_app_1 exited with code 1
I think the COPY
is working but I'm not sure why it's failing to locate the built binary.
I googled around a bit and found out others have reported similar issues with alpine + rust, it might have to do with the MUSL libc, there are apparently ways to fix this but I just ended up changing my builder image to rust:1.64
and my final image to gcr.io/distroless/cc
. Its a bit of an increase in size but I can live with it.
If you are still interested, you could probably just do cargo run ...
somewhere in the builder image and you'd get the segfault.
The issue can be closed I think since it seems it doesn't have anything to do with the lib.
Hmm ok. Alpine has always been an awkward situation with Prisma, and with PCR static linking instead of dynamically like Prisma JS I'm not sure what should be done.
So I am trying to deploy my app inside a Docker container and have come across a strange issue. The app exits silently (without any panics or errors) when connecting to the database. My connection string is correct since I can run the app locally with it.
I tried building in release mode locally and checking with that and it still worked fine.
I enabled trace logs and got the following:
After that it just exits. I am not sure what the issue is and whether its just a container thing.
My Dockerfile's build section in case it sheds some light: