-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use node-alpine in docker #212
Comments
Ideas to improve docker images https://www.docker.com/blog/intro-guide-to-dockerfile-best-practices/ |
Hello @marcjulian Prisma 2.0 now provides binaries for Alpine 🎊 |
@Jolg42 perfect! Thanks for letting me know 👍 will do this when I have the time!! |
I run it with multi-stage docker builds, the builder is node:12, and run in node:12-alpine, it come with errors:
does it need to build and run in same base image? could you please give a Dockerfile example |
Hello @leohxj Could you share your Dockerfile? This works for me for example
|
@Jolg42
I also change
but it run come with error:
|
Prisma version is 2.1.3. |
@leohxj Oh got it! So what happens is during the build the binaries downloaded are the ones that are matching the current OS by default, node:12 is Debian. And when it's executed in node:12-alpine the binaries for Alpine are missing. So what you can do is either to use the same image for both steps or to change the binaryTarget like this for Alpine generator client {
provider = "prisma-client-js"
binaryTargets = ["linux-musl"]
// binaryTargets = ["native", "linux-musl"] // or both if you need the binaries in Debian & Alpine
} See https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/generators#binary-targets for the documentation. |
thanks @Jolg42 |
@Jolg42 @leohxj thank your both for your input on how the I have updated the
|
@Jolg42 is it still necessary to install the prisma cli in a separate step?
It does not take the version into account for |
@marcjulian So I got a word from my colleague Tim that it was needed because by default npm’s permissions on linux are broken for global packages - global packages can’t write in their own directory during install. @prisma/cli package needs to write in its own folder because it needs to download the engines binaries. |
Use node-alpine as docker image if prisma2 provides a binaries for Alpine Linux prisma/prisma#702
The text was updated successfully, but these errors were encountered: