DllNotFoundException in ASP.NET Core 3.1 Docker container
See original GitHub issueDescribe the bug
I’d like to build a docker container of my ASP.NET Core 3.1 application which uses the Speech SDK.
Unfortunately I get the following exception as soon as SpeechConfig.FromEndpoint(any(Uri), any(string))
is called:
DllNotFoundException: Unable to load shared library
'libMicrosoft.CognitiveServices.Speech.core.so' or one of its dependencies.
In order to help diagnose loading problems, consider setting the LD_DEBUG
environment variable: liblibMicrosoft.CognitiveServices.Speech.core.so:
cannot open shared object file: No such file or directory
I’m building it with the “bionics” base images from Microsoft, which is based on Ubuntu 18.04. As far as I read this should be supported.
I’ve provided a small test project which can be run as is to reproduce the issue: SpeechSdkDockerTestProject.zip
To Reproduce Steps to reproduce the behavior:
- Open the project above in Visual Studio (2019, Windows, all updates installed)
- Run the “Docker” target
- Wait until
/helloworld
is loaded in your browser or open it yourself
Expected behavior The string “hello world” should be returned instead of the exception above.
Version of the Cognitive Services Speech SDK 1.8.0 Platform, Operating System, and Programming Language
- OS: Windows
- Hardware: x64
- Programming language: C#
- Browser doesn’t matter
Additional context
- I’m using Linux containers in Docker v2.1.0.5
- running
cat /etc/os-release
inside the Docker container returnsUbuntu 18.04.3 LTS (Bionic Beaver)
- the runtimes directory including the
*.so
libs exist in the container
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Identity Server 4 running within docker container Exception
I am trying to get Identity Server 4 running with ASP.NET Core in a docker container and I keep on getting the following...
Read more >After upgrading .net core from 3.1 to 5 I'm getting error in ...
I have a native application written in c++ and complied into the .so library through docker which I'm using in the .net core...
Read more >Running ASP.NET Core in an Alpine Linux Docker Container
The error here is that the debian docker image we are using doesn't have the nightly version of the 2.1 runtime installed and...
Read more >Why isn't my ASP.NET Core app in Docker working?
In this post I describe a problem where my ASP.NET Core app in Docker wasn't responding to requests. This post debugs and diagnoses...
Read more >Docker Support for My .NET Core Blog System on Azure
When I submit my code to GitHub, Azure DevOps will kick in, build the Docker image and push to Docker Hub. Then it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone running their .NET Core 3.1 application using the official image (whose base is Debian 10), I simply had to install the libasound2 library for our application to use the Microsoft.CognitiveServices.Speech package. Here’s all I needed to add to the Dockerfile:
It would be nice if Microsoft could update their documentation to make it more clear what exactly is required to add on to their official Linux images in order to be able to use the Speech service.
Please note that Linux system requirements are stated on the “About the Speech SDK” page: https://docs.microsoft.com/en-us/azure/cognitive-services/speech-service/speech-sdk?tabs=linux Debian 10 is not yet officially supported, but in practice you just need to install the same packages as on Debian 9, incl. libasound2. For libssl, use libssl1.1 instead of libssl1.0.2.