bytecodealliance / bytecodealliance/wasmtime-dotnet
Error loading shared library libwasmtime in alpine docker image
- Dominant language
- C#
- Stars
- 519
- Forks
- 67
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 1
Description
I am experiencing this error when trying to build my docker image that uses wasmtime.
```
Unhandled exception. System.DllNotFoundException: Unable to load shared library 'wasmtime' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libwasmtime: No such file or directory
at Wasmtime.Engine.Native.wasm_engine_new()
at Wasmtime.Engine..ctor()
```
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 `` instead of the ProjectReference.
I tried 3 different Dockerfiles:
```
# FROM mcr.microsoft.com/dotnet/sdk:5.0-bullseye-slim
# FROM mcr.microsoft.com/dotnet/sdk:5.0-alpine
# FROM mcr.microsoft.com/dotnet/sdk:5.0-focal
COPY . /build
WORKDIR /build
RUN dotnet build -c Release
ENTRYPOINT ["dotnet", "run"]
```
All 3 build successfully with `docker build -t test .`. When run with `docker run test`, Debian and Ubuntu both print `Hello from C#, WebAssembly!` as expected, but alpine throws the above exception.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.