-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Precompiled engine files for aarch64-unknown-linux-musl
target (Alpine Linux on ARM, e.g. M1)
#8478
Comments
I'm maintaining Docker images for cross compile: https://github.com/orgs/napi-rs/packages/container/package/napi-rs%2Fnodejs-rust. |
This could be "solved" by using |
What can I do to help get support for this implemented? |
Any plan or timeline to support this? |
v3.7.0 has been released, but it seems that this issue is not fixed, is it? |
The issue is not closed, hence the problem is not solved and stays open here for tracking. |
Is there a recent error message change? it is failing all docker Prisma builds with the pre-compiled prisma image workaround. One of the requirements in my case is to run a docker image build on arm self-hosted runners to reduce the docker image build time. I was able to work it around by pre-compile prisma as the docker base image to have the stack build running on arm node, but a recent error message change failed our entire build pipeline. ( The error message was changed prob around 4hours before this comment )
|
NVM - fixed our code version to 4.8.0.
@jkomyno This change broke all pre-compiled workarounds on alpine 🥲. |
Those who are facing the same issue as me using pre-compiled Prisma image to run Prisma on alpine arm64.
|
How to apply this with a docker-compose? |
@csulit you can do it like this:
|
Add cross-compile images for ARM64 musl. Ref: prisma/prisma#8478 Ref: prisma/engineer#87
Build the engines for `linux-musl-arm64-openssl-1.1.x` and `linux-musl-arm64-openssl-3.0.x`. Ref: prisma/prisma#8478 Ref: prisma/engineer#87 Ref: prisma/engine-images#66
Hi everyone! Native support for Alpine Linux on ARM64 CPUs is now merged and will be released in Prisma 4.10.0 on Tuesday. You shouldn't need any workarounds like running the image in emulation or building the engines yourselves starting with 4.10.0. Please let us know if you have any feedback! |
I tested this yesterday and works like a charm, error message is also clear finally :)
Dockerfile
schema.prisma
Just fyi - in my case, it seems we were building docker images on different architecture then running them, hence I had to add a binary target. Also, we wanted to upgrade node to 18, which was failing before, and without a clear error message I didn't wanted to invest time in playing with building it FROM prisma source. So thanks @aqrln :) great update |
@bmxpiku fyi you don't have to install |
oh, right - thanks 👍 |
ARG ALPINE_VERSION=alpine3.17
It is not working even if i add
to my Dockerfile
|
@Romanchuk this just looks like the expected Query Engine library file is not present in the generated client directory for whatever reason. The "You incorrectly pinned it to linux-musl-openssl-3.0.x" part is misleading, sorry about this, it's a known issue. Could you please open a new issue or discussion and provide your Dockerfile? Thank you! |
Hi, I'm still facing the issues, none of the given fixes work for me. Here's my Dockerfile: FROM node:alpine
WORKDIR /app
COPY package.json /app/package.json
RUN apk add openssl3
RUN npm install
COPY . /app
RUN npx prisma generate
EXPOSE 3000
CMD ["npm", "run", "start"] and my generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-musl-openssl-3.0.x"]
} test-1 | PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "linux-musl-arm64-openssl-3.0.x". Even if I provide the suggested targets from the error message problem still occurs. I use the M2 processor. Right now I can manage to not display this error by using the |
@Sakub you added |
@aqrln Even if I add |
@Sakub did you regenerate the client after that? If it doesn't help, please open a new issue with reproduction, or a new discussion if you don't think you're hitting a bug and just need help. This issue is already fixed and is unrelated to your problem, and posting here sends an email to more than 50 people that were subscribed to it. |
Problem
Right now you can't use Prisma on Docker alpine on M1 mac as it requires
aarch64-unknown-linux-musl
binaries. As M1 will see more adoption, people will run into this frequently.Suggested solution
Provide precompiled binaries for
aarch64-unknown-linux-musl
target like we have precompiled binaries forx86-linux-musl
Alternatives
node:lts
instead ofnode:lts-alpine
which is not ideal.Additional context
#7755
Naming as
unknown
is intended like that, see more information internally: https://prisma-company.slack.com/archives/C016KUHB1R6/p1627469574008300?thread_ts=1626873669.001400&cid=C016KUHB1R6The text was updated successfully, but these errors were encountered: