Prisma fails to generate artifacts with NodeJS Alpine image on M1 Mac
See original GitHub issueBug description
Following the request from Jan here, I’ve created this as a new ticket.
While attempting to build/run prisma using a NodeJS Alpine image, prisma fails to generate artifacts during the postinstall
script, as a result, running the application cannot find generated models and typescript type-checking fails.
When observing the npm install
logs, I note the following error:
Error: Unknown binaryTarget linux-arm-openssl-undefined and no custom binaries were provided
. Which has been tracked before, but according to recent posts, this should still work within Rosetta 2
emulation, right?
I should note, that if I run a general FROM node:14
, the project builds no problem, using FROM node:14-slim or alpine
fails.
I’ve attached the docker build logs so you can see the failing script line here:
How to reproduce
- Use M1 Mac
- Clone the following NestJS Prisma repo I’ve created: https://github.com/uncvrd/prisma-alpine-docker
- Build the image using:
docker build -t [IMAGE TAG] --target development --no-cache --progress plain .
- Run the built image locally and observe the missing generated files
Expected behavior
I expect to be able to build and run using NodeJS Alpine
on M1 Mac. I can confirm that this Dockerfile
works as expected on an Intel Mac so I guess the Rosetta 2
emulation is not running as expected?
Prisma information
Prisma schema etc. is referenced in the repository above.
Environment & setup
- OS: Mac OS Big Sur 11.4
- Database: PostgreSQL
- Node.js version: 14 (in docker image)
Prisma Version
prisma : 2.21.2
@prisma/client : 2.21.2
Current platform : darwin
Query Engine : query-engine e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/query-engine-darwin)
Migration Engine : migration-engine-cli e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt e421996c87d5f3c8f7eeadd502d4ad402c89464d (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : e421996c87d5f3c8f7eeadd502d4ad402c89464d
Studio : 0.371.0
^ ran this inside the docker container, I do find it interesting that it shows darwin
as this is an alpine
image running in the docker container?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:24 (8 by maintainers)
Top GitHub Comments
Not using Alpina will result in really large Docker images, so it would be helpful if binaries get made for this situation.
Hey @janpio I have now tested on 3 different devices using the referenced repo:
Error: Unknown binaryTarget linux-arm-openssl-undefined and no custom binaries were provided
Error: Unknown binaryTarget linux-arm-openssl-undefined and no custom binaries were provided
Hope that helps, What can I help with next?