赞
踩
报错信息:Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibgdiplus: cannot open shared object file: No such file or directory\
原因分析:libgdiplus是一个Mono库,用于对非Windows操作系统提供GDI+兼容的API,libgdiplus是mono中的System.Drawing依赖的一个组件,用于显示web页面基本颜色等。可用于生成netcore验证码,处理图片等
业务需求:在客户Linux机器上部署项目,导出功能是在本地正常使用的,但是部署完成之后报错无法导出(获取文件流错误)
解决办法:
在Dockerfile文件中加入以下四行代码即可,在打包的同时同时会编译下面的代码
- RUN apt-get update -y
- RUN apt-get install -y libgdiplus
- RUN apt-get clean
- RUN ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。