System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies .NET Core 图片操作在 Linux/Docker 下的坑

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

RUN echo "deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib \
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib \
deb http://mirrors.aliyun.com/debian-security stretch/updates main \
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main \
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib \
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib \
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib" > /etc/apt/sources.list

RUN apt-get update -y && apt-get install -y libgdiplus && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["xxx/xxx.csproj", "xxx/"]
COPY ["xxx.xxx/xxx.xxx.csproj", "xxx.xxx/"]
COPY ["xxx.xxx/xxx.xxx.csproj", "xxx.xxx/"]
COPY ["xxx/xxx.xxx.csproj", "xxx/"]
COPY ["xxx.xxx/xxx.xxx.csproj", "xxx.xxx/"]
COPY ["xxx.xxx/xxx.xxx.csproj", "xxx.xxx/"]
COPY ["xxx.xxx/xxx.xxx.csproj", "xxx.xxx/"]
COPY ["xxx.xxx/xxx.xxx.csproj", "xxx.xxx/"]
COPY ["xxx.xxx/xxx.xxx.csproj", "xxx.xxx/"]
RUN dotnet restore "xxx/xxx.csproj"
COPY . .
WORKDIR "/src/xxx"
RUN dotnet build "xxx.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "xxx.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "xxx.dll"]

参考文章:https://www.cnblogs.com/stulzq/p/10172550.html

https://www.cnblogs.com/stulzq/p/9339250.html

System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies .NET Core 图片操作在 Linux/Docker 下的坑

原文地址:https://www.cnblogs.com/lkd3063601/p/12672360.html

时间: 2024-08-26 05:22:22

System.DllNotFoundException: Unable to load shared library 'libdl' or one of its dependencies .NET Core 图片操作在 Linux/Docker 下的坑的相关文章

Unhandled Exception:System.DllNotFoundException: Unable to load DLL"**"

在项目中使用C#代码调用C++ DLL时.常常会出现这个问题:在开发者自己的电脑上运行没有问题,但是部署到客户电脑上时会出现下面问题: Unhandled Exception:System.DllNotFoundException: Unable to load DLL"**":找不到指定的模块. 出现这个问题的原因:一般是该客户电脑上缺少该DLL的依赖项.一般来说比较常见的缺少项是msvcr1200.dll msvcp1200.dll.具体缺少什么,需要使用Dependency Wa

System.DllNotFoundException: Unable to load DLL 'libgdiplus': The specified module could not be found.

netcore 使用System.Drawing 出现如下错误: Unhandled Exception: System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'libgdiplus': The specified module could not be found.

YARN加载本地库抛出Unable to load native-hadoop library解决办法

YARN加载本地库抛出Unable to load native-hadoop library解决办法 用官方的Hadoop 2.1.0-beta安装后,每次hadoop命令进去都会抛出这样一个Warning WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 设置logger级别,看下具体

关于 unable to load shared object 'C:\Program Files\R\R-3.0.3\library\stats\libs\i386\stats.dll'

这个问题花了我3个小时差文档解决.最终一位外国朋友解答了我的问题:http://rdotnet.codeplex.com/workitem/117 其实这个问题很简单就是,在R目录下的:C:\Program Files\R\R-3.0.3\library\stats\libs\i386这个目录下,拷贝一份:这个目录下的文件:C:\Program Files\R\R-3.0.3\bin\i386.然后就ok了. 看了这份回答,估计你都得喊哥了. 关于 unable to load shared o

Hadoop问题解决:WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

在配置好hadoop的环境之后,命令启动./start-all.sh发现经常出现这样的一个警告: WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 关于解决这个问题总结了一下方法: 按警告的描述是说  hadoop的native库导入失败,定位这个问题就是要看下native目录下的静态库

php 编译安装插件提示PHP Warning: PHP Startup: Unable to load dynamic library 报错

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20090626/"xcache.so"' - /usr/local/lib/php/extensions/no-debug-non-zts-20090626/"xcache.so": cannot open shared object file: No s

Unable to load native-hadoop library for your platform(已解决)

1.增加调试信息寻找问题 2.两种方式解决unable to load native-hadoop library for you platform 附:libc/glibc/glib简介 参考: 1.http://my.oschina.net/swuly302/blog/515853[66号公路: Hadoop Unable to load­ ­n­­ati­v­e­-­h­a­­d­o­o­­p library for your platform] 2.http://blog.sina.co

***XAMPP:报错 Unable to load dynamic library的解决方法

A PHP Error was encountered Severity: Core Warning Message: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/php_pdo_mysql.dll' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20131226/php_pdo_mysq

Hadoop “Unable to load native-hadoop library for y

http://devsolvd.com/questions/hadoop-unable-to-load-native-hadoop-library-for-your-platform-error-on-centos The answer depends... I just installed Hadoop 2.6 from tarball on 64-bit CentOS 6.6. The Hadoop install did indeed come with a prebuilt 64-bit