Open willhausman opened 2 years ago
Currently the wasmtime-dotnet package bundles a wasmtime executable that is not targeted for musl libc.
Try installing the libc6-compat
package into your alpine-based image. That might be enough to get wasmtime loaded.
If not, you may either need to install a full glibc into your image or rebuild both the wasmtime library targeted against musl libc and the wasmtime-dotnet package to bundle the musl-libc-targeted wasmtime. That's obviously easier said than done, though.
If the upstream Wasmtime repo starts producing musl libc artifacts, I can easily update the wasmtime-dotnet package to bundle it for the musl RIDs.
@peterhuene what would it take to make use of the aarch64 artifacts from upstream? I recently started working with an M1 MacBook Pro, and am now getting this same behavior locally. Unable to load shared library wasmtime
.
@willhausman is that without using alpine, right? It should be easy enough to bundle aarch64 RID artifacts in the package, we're just not doing so yet.
Correct, without alpine. I can open a separate issue if you prefer.
That'd be great, thanks!
Working for me!
[ALPINE ] alpine:3.18
RUN apk add libwasmtime --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
Just got the same problem on alpine:3.18 on .NET 8 (I used dotnet-opa-wasm
for authorization with OPA policies)
For those people who couldn't make it work. The full solution is as below.
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine3.18 AS base
RUN addgroup -g 1000 -S <username> && \
adduser -u 1000 -S <username> -G <username>
RUN echo 'http://dl-cdn.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories
RUN apk update --no-cache && apk upgrade --no-cache
RUN apk add libwasmtime --repository=dl-cdn.alpinelinux.org/alpine/edge/testing
# cut of for brevity
# ...
I am experiencing this error when trying to build my docker image that uses wasmtime.
I stopped trying to build my own docker image and instead used the https://github.com/bytecodealliance/wasmtime-dotnet/tree/main/examples/hello sample project. The only thing I changed was to use
<PackageReference Include="Wasmtime" Version="0.32.0-preview1" />
instead of the ProjectReference.I tried 3 different Dockerfiles:
All 3 build successfully with
docker build -t test .
. When run withdocker run test
, Debian and Ubuntu both printHello from C#, WebAssembly!
as expected, but alpine throws the above exception.