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
Library may be corrupt (missing libz.so.1
) when using distroless Docker images
#16205
Comments
Unable to load Node-API Library
when using prisma in docker container from gcr.io/distroless/nodejs18-debian11
Same error on my side using Docker, any news?
|
Hi @nassim-kachroud, could you tell us exactly which Docker image you're using? Ideally, are you able to share your Dockerfile with us? Thanks. |
Having the same issue. |
Same error here using a |
Is there a workaround for this issue? |
I have tried to upgrade to node 18, but no luck. |
I can workaround by using So it seems the issue only occurs with newest distrib versions, maybe the toolchain used to build prisma binary is a bit dated ? |
I was getting this issue on |
I faced same issue. this is my workaround: set up image tag explicitly to use alpine 3.16. -FROM node:16-alpine
+FROM node:16-alpine3.16
WORKDIR /app
COPY --from=prod-build /app/prod_node_modules ./node_modules
COPY --from=build /app/dist ./dist
COPY --from=build /app/prisma ./prisma
COPY --from=build /app/package.json ./package.json |
Is this a problem with docker or prisma? |
Compatibility between the content of the Docker image and the software it is running, and how Prisma detects and handles these. |
Having the same problem with docker running on WSL-2 at Windows 11, already tried different versions of node, without success so far |
This trick solved the problem for me: t3-oss/create-t3-app#975 (comment) |
For people mentioning Let's keep the discussion on this issue focused on |
@vimutti77 a deeper inspection of this issue revealed that the Prisma Client fails to import the query engine because the From your reproduction, I see you're using a multi-stage Docker build process, with Assuming you're running Docker on an FROM gcr.io/distroless/nodejs18-debian11:debug
# set working directory
WORKDIR /app/
# copy node_modules
COPY --from=deps /app/node_modules/ /app/node_modules/
# copy libz.so.1 from Debian, which was causing the
# "Library may be corrupt" error
COPY --from=deps /lib/x86_64-linux-gnu/libz.so.1 /lib/x86_64-linux-gnu/libz.so.1
# copy db & script
COPY prisma /app/prisma
COPY index.js /app/index.js
CMD ["/app/index.js"] If you're on |
Unable to load Node-API Library
when using prisma in docker container from gcr.io/distroless/nodejs18-debian11libz.so.1
) when using the gcr.io/distroless/nodejs18-debian11
Docker image
libz.so.1
) when using the gcr.io/distroless/nodejs18-debian11
Docker imagelibz.so.1
) when using distroless Docker images
Thanks, now it works. Maybe we should add about this in the documentation then close the issue? |
Reopening for now because engineer must be updated in prisma-engines now, will be closed by prisma/prisma-engines#3951 |
Merged, the issue won't occur anymore starting with Prisma 4.14.0. |
Bug description
When using prisma in
gcr.io/distroless/nodejs18-debian11
. I got this errorHow to reproduce
npm run build
npm run start
Expected behavior
It should no error and log
count: 0
Prisma information
Environment & setup
Prisma Version
I got this error when I try to check the prisma version inside the docker container
The text was updated successfully, but these errors were encountered: