-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Docs: add binaryTargets to docs #1328
Comments
In case it helps someone, this is how ended up getting this to build in a container: FROM golang:1.22-bookworm AS builder
ARG PRISMA_CLIENT_BINARY_TARGETS='["darwin-arm64","linux-static-x64"]'
ARG PRISMA_CLIENT_BINARY_TARGETS
RUN echo -e "Prisma Client Go binary targets: $PRISMA_CLIENT_BINARY_TARGETS"
WORKDIR /workspace
COPY ./ ./
ENV CGO_ENABLED=0
# generate the Prisma Client Go client
ENV PRISMA_CLIENT_BINARY_TARGETS="$PRISMA_CLIENT_BINARY_TARGETS"
RUN go run github.com/steebchen/prisma-client-go generate --generator=db
RUN go build -o runtime ./cmd/my-go-program
... Thanks for the help on this, @steebchen ! We're absolutely loving this tool. |
@alampros Thanks for your kind feedback! you can probably omit the |
@steebchen not sure if I've missed part of the docs but I can't seem to generate query engine binaries for x64 using my m1 mac. Is that perhaps expected? I.e. the above docker file only gives me the darwin binary. Same if I use the binaryTargets-field in the schema file. |
@SiddyP You can use native to select the correct one locally and then any additional ones for your server: |
@steebchen thanks. I realise now that the unexpected behaviour for me is that binaries end up in two places when I build the container. The arm64-one ends up in For some reason I was expecting that they'd all end up in the temp dir of the container.
|
For now I'll just copy the binaries I find in the builder stage of my image. Good enough workaround for the usecase RUN mkdir -p prisma-engines && \
find /root/.cache/prisma/binaries/cli/ -name 'prisma-query-engine-*' ! -name '*.tmp' \
-exec cp {} ./prisma-engines/ \; |
No description provided.
The text was updated successfully, but these errors were encountered: