Skip to content
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

Prisma CLI not working on Alpine Linux #357

Closed
jakubmeysner opened this issue Jan 11, 2021 · 4 comments
Closed

Prisma CLI not working on Alpine Linux #357

jakubmeysner opened this issue Jan 11, 2021 · 4 comments
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.

Comments

@jakubmeysner
Copy link

Prisma CLI isn't working on Alpine Linux. Though it prints that that it has successfully downloaded, neither the version command (it doesn't print anything) nor the generate command (it panics) work. /root/.cache/prisma doesn't exist. If I replace the alpine image with the standard one (golang:1), everything works fine.

Error:

panic: could not run [generate]: fork/exec /root/.cache/prisma/binaries/cli/2.11.0/prisma-cli-linux: no such file or directory

goroutine 1 [running]:
main.main()
        /go/pkg/mod/github.com/prisma/[email protected]/main.go:29 +0x493
exit status 2

Dockerfile:

FROM golang:1-alpine
WORKDIR /app
COPY go.mod .
COPY go.sum .
RUN ["go", "mod", "download"]
RUN ["go", "run", "github.com/prisma/prisma-client-go", "version"]
COPY ./prisma/schema.prisma ./prisma/
RUN ["go", "run", "github.com/prisma/prisma-client-go", "generate"]
COPY . .
RUN ["go", "build"]
RUN ["chmod", "+x", "./docker/entrypoint.sh"]
ENTRYPOINT ["./docker/entrypoint.sh"]
CMD ["./app"]
@steebchen steebchen added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Jan 11, 2021
@steebchen
Copy link
Owner

I can confirm this. I think the problem is that we use https://github.com/vercel/pkg for packing the NodeJS cli into the Go client, and it looks like something goes wrong on alpine linux specifically.

I remember when debugging alpine stuff that I ran into this error, and I think the file actually exists and the error message is simply misleading, though I'm not 100% sure.

For now, please use a non-alpine docker image. A much better way to optimise docker images is to use multi-stage builds, so the final image just uses a few megabytes of the final go binary, regardless of how big the build container was.

@tonyabracadabra
Copy link

Is there any updates on this problem?

@johnpena
Copy link

johnpena commented Jun 2, 2021

I had this issue with alpine as a base image, switching over to 1.16.4-buster fixed the issue.

@steebchen
Copy link
Owner

fixed via #814 a while ago

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug.
Projects
None yet
Development

No branches or pull requests

4 participants