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

Can't run Mono.Posix on alpine docker #18

Open
tomer-amir opened this issue Mar 29, 2022 · 0 comments
Open

Can't run Mono.Posix on alpine docker #18

tomer-amir opened this issue Mar 29, 2022 · 0 comments

Comments

@tomer-amir
Copy link

I tried using this lib running a net6.0 app on an alpine docker container, but it seems to fail on the following error:

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'Mono.Unix' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library libMono.Unix: No such file or directory
   at Mono.Unix.Native.Syscall.stat(String file_name, Stat& buf)
   at Mono.Unix.UnixFileSystemInfo.GetFileStatus(String path, Stat& stat)
   at Mono.Unix.UnixFileSystemInfo.Refresh(Boolean force)
   at Mono.Unix.UnixFileSystemInfo..ctor(String path)
   at Mono.Unix.UnixFileInfo..ctor(String path)
   at Program.<Main>$(String[] args) in /code/Program.cs:line 3

Running the same code on a Debian container seems to work.

My code:

using Mono.Unix;

var test = new UnixFileInfo("/tmp");
Console.WriteLine(test);

Here is a repo that can help reproduce the issue: https://github.com/tomer-amir/mono-alpine-demo

Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant