-
Notifications
You must be signed in to change notification settings - Fork 79
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
Failed to compile under docker golang:alpine #21
Comments
Thanks for the report! This library uses CGO, however, and is as a result pretty dependant on the native C runtime. The prebuilt binaries checked into this repository and used on taggs only work with glibc, there's not a prebuilt binary for musl. If you'd like, though, then we'd need to make a binary release for musl on wasmtime itself, and then that could get consumed here! |
Docker is an important platform for deploying and distributing go applications, and the alpine container can effectively reduce the size of image. So it is worth to support it. |
I agree that this would be great to support for this reason, yes.
So IIUC we'd need to add a musl build config to Wasmtime, and optionally use that in wasmtime-go? |
It would be best that being auto-selected in alpine but optional in other linux distro. If it impossible, providing a guide about manually installing wasmtime in system and letting wasmtime-go use external library would be also great. |
I suppose if wasmtime was pushing a musl c-api tarball, we could use that here, and copy the file into import (
_ "github.com/bytecodealliance/wasmtime-go/build/linux-x86_64" # glibc
_ "github.com/bytecodealliance/wasmtime-go/build/linux-x86_64-musl # musl
) ... but I could be missing something. 🤔 |
Ref: bytecodealliance/wasmtime#2951 Ref2: bytecodealliance/wasmtime-go#21 Signed-off-by: Simar <[email protected]>
Ref: bytecodealliance/wasmtime#2951 Ref2: bytecodealliance/wasmtime-go#21 Signed-off-by: Simar <[email protected]>
We're running into this with our project that uses OPA/wasm (which uses wasmtime-go internally). Does this mean wasmtime-go can't be used on an alpine base image until this is resolved? |
It should be possible to make a custom build of Wasmtime for Alpine using musl-libc, but otherwise no, there is no precompiled binary for musl libc for you to use. |
I've just hit this today, are there any specific steps I could help with? |
Dockerfile
It seems an upstream issue between wasmtime and alpine(musl)?
The text was updated successfully, but these errors were encountered: