dock comm usr sdk plus container localtime pda window
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
docker之使用System.Drawing生成图片缺少Gdiplus.dll错误
dock comm usr sdk plus container localtime pda window
原文:http://www.cnblogs.com/xmai/p/7754840.html
来源: http://www.bubuko.com/infodetail-2373212.html