zoukankan      html  css  js  c++  java
  • .netcore基础镜像缺少libgdiplus包导致构建缓慢的问题

    每次构建下载安装libgdiplus,导致构建非常慢。

    FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
    WORKDIR /app
    EXPOSE 80
    
    COPY  bin/Release/netcoreapp3.1 .
    
    #System.Drawing.Common
    RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list 
    RUN apt-get update -y && apt-get install -y libgdiplus locales fontconfig && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
    
    ENTRYPOINT ["dotnet", "xxx.dll"]
    

    制作一个带libgdiplus的基础镜像,Dockerfile ↓

    FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim
    
    RUN echo "deb http://mirrors.aliyun.com/debian/ buster main contrib non-free 
              deb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free 
              deb http://mirrors.aliyun.com/debian/ buster-backports main contrib non-free 
              deb http://mirrors.aliyun.com/debian-security buster/updates main contrib non-free 
              " > /etc/apt/sources.list
    
    RUN apt-get update -y && apt-get install -y libgdiplus locales fontconfig && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
    

    构建镜像aspnet:3.1-buster-slim-gdi

    docker build -f Dockerfile路径 -t mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim-gdi .
    

    参考 https://www.cnblogs.com/wh-blog/p/11797530.html

  • 相关阅读:
    Vue-CLI项目-axios模块前后端交互(类似ajax提交)
    Vue-CLI项目中路由传参
    HTML标签嵌套规则
    POJ1050 To the Max
    POJ2488 A Knight's Journey
    POJ1083 Moving Tables
    洛谷P1265 公路修建
    POJ2236 Wireless Network
    洛谷P1991 无线通讯网
    POJ1018 Communication System
  • 原文地址:https://www.cnblogs.com/wu_u/p/13617161.html
Copyright © 2011-2022 走看看