-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Provide binaries for Alpine Linux #702
Comments
Internal Note: Find out what that actually means and ask @mavilein if this should be implemented. |
related #938 |
I'm currently working on this as part of #938. The best route to take would be to provide a repository for each distro you support, and in your package manifest for that distro, you would declare what dependencies your package has, so that the package manager can find the best match. Then the user can use the native package manager to to determine the best way to install packages in a way that is compatible with their platforms internet and security policies. My suggestion is to support package channels/repositories for the following formats:
|
Hey @LongLiveCHIEF, although I understand where you are coming from this seems out of scope of what @steebchen was describing here - and what will be implemented as first step to get Prisma running on Alpine Linux - but justifies you opening a new issue, as it raises valid points and might be a good idea. Can you please do that? Thanks. |
We don't have the resources to tackle this right now, but if you're blocked on this please let us know and we'll re-prioritize! |
Rust with Musl libc is not straight forward. |
Just did a container scanning in Google Cloud. Looks like using the Node base image is bringing in a lot of vulnerabilities 👀 Please let me know when you are there and I can be your alpha user 😅 Tried changing it to alpine and I got this: Also, saw this article: https://snyk.io/blog/take-actions-to-improve-security-in-your-docker-images/ |
Btw, looks like node-rdkafka had similar issues (Blizzard/node-rdkafka#361) and they have a solution here: https://github.com/Blizzard/node-rdkafka/blob/master/examples/docker-alpine.md I tried it but somehow, it didn't work. Maybe, I am doing it wrong. |
Nvm, As @olup suggested here: prisma/prisma-client-js#173 (comment) this works for me. Used this as base image:
But since it installed Node v10.x and was using older alpine image, did some googling and this is now my base image:
Taken from https://github.com/jeanblanchard/docker-alpine-glibc |
For anyone wanting to use Alpine currently, you can use Cross: https://github.com/rust-embedded/cross to compile binaries. I do this for arm64 and x86_64 now by using the To cross-compile yourself easily:
HTH |
Looks like @tvvignesh solution stopped working with the latest prisma/cli release. This was a viable solution for me to run prisma on Alpine however now I get this error when running
This runs fine on |
@sunil-sadasivan It works even with the latest release. I use it daily (currently i am on I run generate like this within the docker file: |
@tvvignesh hmm, the latest I believe is |
@sunil-sadasivan Ahh. Haven't checked with Related: #1635 |
Temporary alternative: I've been building binaries for Alpine for awhile now, you can grab them from my Gitlab pipeline here: https://gitlab.com/npappas/prisma-engines/pipelines, find the version you need and download the artifacts from the most recent build on that version. There are binaries for amd64 and arm64 included. You'll need to copy them in as part of your image build, and then use the ENV variables to tell prisma where the binaries are. I have beta.3 building now, it'll be done in about an hour. |
Having had a chance to use the newly built beta3 binaries, I can confirm @sunil-sadasivan 's issue - there was a change made in #1635 where the error is dumped out for Alpine, regardless of it valid binaries exist, or the platform can run stock ones. I opened a new issue to track this: #2266 |
While I am about to check this issue from my end, looks like the changes @Jolg42 described here #1635 (comment) breaks the Alpine builds as @sunil-sadasivan and @radicand have mentioned. Any alternative? It used to work till I see this is the line where you are throwing the error: prisma/src/packages/fetch-engine/src/download.ts Lines 74 to 80 in c86af74
I also see a change in binary from prisma to query-engine here: #1920 - have to check if any of it has any implications for alpine users. Not sure what other changes would impact this. Any ideas? CC: @janpio @timsuchanek |
Thanks @tvvignesh so the error thrown was intended to make it easier for people to know that Alpine was not supported. (The previous error message was not helpful about that). It was not intended to block you from using Alpine, so this will be changed to a warning instead 😅 This is tracked here #2266 and was just closed now 🎊 |
Great! Will test it out today and get back. Btw, is it released in alpha? Or is it better to wait for the next beta? |
@tvvignesh It is indeed in the latest alpha since 2.0.0-alpha.1121 So you can already use it locally, I won't recommend to use it in production because the alpha channel is not as stable. The next beta is coming soon 😉 |
I updated my Dockerfile this morning to streamline how I integrate the binaries I build into my Docker images - see https://gitlab.com/recipe-cookbook/backend/-/blob/3e4b7005d261a683919ebd09e03bbbfdad88a6a1/Dockerfile for an example. Available architectures are x86_64 and arm64. If you choose to use this approach, just keep your prisma version in sync with the build artifact links available at https://gitlab.com/npappas/prisma-engines/pipelines Still hoping we'll get natively built binaries some day. |
Thanks a lot for reporting 🙏 In case it’s not fixed for you - please let us know and we’ll reopen this issue! |
No need to compile custom binaries for Alpine anymore :confetti_ball: |
No need to install |
I can confirm this works on alpha - thanks everyone for making this happen! For anyone tracking, I'll still be building binaries for alpine/arm if/until that happens down the road. |
Currently, running Prisma on Alpine Linux fails, because the libssl version does not match.
For more information about this error, see prisma/prisma-client-js#173
Steps needed to make this work:
We currently provide alpine binaries but it seems they're very unstable, so we have to revisit this and best built the alpine build process from scratch. This involves a lot of debugging and finding out if we need multiple libssl variations.
The text was updated successfully, but these errors were encountered: