在dockerfile 中添加linux
FROM microsoft/dotnet:2.1-aspnetcore-runtime
RUN apt-get update RUN apt-get install -y --no-install-recommends libgdiplus libc6-dev
为何会找不到 libdl (libdl.so.2) 呢?是由于 System.Drawing.Common 是在 /usr/lib/x86_64-linux-gnu/
这个路径中找的,而容器中 libdl.so.2 存在于 /lib/x86_64-linux-gnu/
目录中,安装 libc6-dev
以后 /lib/x86_64-linux-gnu/
中就有了 libdl.so.2 ,问题就解决了。git
如今不须要 ln -s libgdiplus.so gdiplus.dll
,System.Drawing.Common 已经改了代码,直接加载 libgdiplus.so ,详见实现源码github
解决方法是在 https://github.com/VahidN/EPPlus.Core/issues/40 的回复中发现的docker