Windows下面运行正常,部署到Linux的docker上之后,报错显示缺少gdiplus.dll;这个是Windows的gdi组件,在Linux下要安装环境

修改Dockerfile;添加gidplus组件的安装:

RUN apt-get update
RUN apt-get install libgdiplus

完整如下:

#依赖原始的镜像,dotnet镜像根据实际版本下载好
FROM microsoft/dotnet:1.1.4-sdk

## 时区设置,默认是【格林威治时间】
#ENV TZ=Asia/Shanghai
#RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#
RUN apt-get update
RUN apt-get install libgdiplus 
#设置COPY命令的工作目录
WORKDIR /app

# 把当前目录的文件复制到【root】目录下去
COPY . /app/

# 镜像对外监听端口
EXPOSE 9001

# dotnet coer 命令启动入口DLL文件
ENTRYPOINT ["dotnet", "DotnetCoreQrcoderTest.dll"]

 

解决方法二

直接修改基础镜像后制作成自己的镜像

进行镜像对应的容器

docker run -it container01

docker exec -ti container01 /bin/bash

apt-get install libgdiplus

(如果失败,先运行apt-get update 在运行上面的命令)

exit

docker commit container01  myimages/aspnetcore:2.0 

 

( docker save container01 > lind_aspnetcore.tar //当然也可以把容器保存为tar包)

 

文档引用:

http://www.cnblogs.com/lori/p/7543886.html

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
  • 2021-06-12
  • 2021-05-14
  • 2021-12-12
  • 2021-09-04
猜你喜欢
  • 2022-12-23
  • 2021-09-03
  • 2022-01-13
  • 2021-07-20
  • 2022-12-23
  • 2021-05-16
相关资源
相似解决方案