<small id='fJzFS'></small><noframes id='fJzFS'>

    1. <legend id='fJzFS'><style id='fJzFS'><dir id='fJzFS'><q id='fJzFS'></q></dir></style></legend>
      <i id='fJzFS'><tr id='fJzFS'><dt id='fJzFS'><q id='fJzFS'><span id='fJzFS'><b id='fJzFS'><form id='fJzFS'><ins id='fJzFS'></ins><ul id='fJzFS'></ul><sub id='fJzFS'></sub></form><legend id='fJzFS'></legend><bdo id='fJzFS'><pre id='fJzFS'><center id='fJzFS'></center></pre></bdo></b><th id='fJzFS'></th></span></q></dt></tr></i><div id='fJzFS'><tfoot id='fJzFS'></tfoot><dl id='fJzFS'><fieldset id='fJzFS'></fieldset></dl></div>

        <bdo id='fJzFS'></bdo><ul id='fJzFS'></ul>
    2. <tfoot id='fJzFS'></tfoot>
    3. 无法加载共享库“libgdiplus"- Docker [带有 Aspose API 的 .NET 应用程序]

      时间:2023-09-17
        <tbody id='vCbWd'></tbody>
    4. <i id='vCbWd'><tr id='vCbWd'><dt id='vCbWd'><q id='vCbWd'><span id='vCbWd'><b id='vCbWd'><form id='vCbWd'><ins id='vCbWd'></ins><ul id='vCbWd'></ul><sub id='vCbWd'></sub></form><legend id='vCbWd'></legend><bdo id='vCbWd'><pre id='vCbWd'><center id='vCbWd'></center></pre></bdo></b><th id='vCbWd'></th></span></q></dt></tr></i><div id='vCbWd'><tfoot id='vCbWd'></tfoot><dl id='vCbWd'><fieldset id='vCbWd'></fieldset></dl></div>
      1. <tfoot id='vCbWd'></tfoot>

        <legend id='vCbWd'><style id='vCbWd'><dir id='vCbWd'><q id='vCbWd'></q></dir></style></legend>
          • <bdo id='vCbWd'></bdo><ul id='vCbWd'></ul>

              <small id='vCbWd'></small><noframes id='vCbWd'>

                本文介绍了无法加载共享库“libgdiplus"- Docker [带有 Aspose API 的 .NET 应用程序]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                当我创建一个用于部署的 docker 文件时,该应用程序通常在开发环境中工作,它因 libgdiplus 问题而失败.

                The application is normally working with development environment when i create a docker file for deployment it getting failed with libgdiplus issue.

                DockerFile

                FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS base
                WORKDIR /app
                FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build
                
                
                RUN apt-get update && apt-get install -y apt-utils
                RUN apt-get install -y libfontconfig1
                RUN apt-get install -y libgdiplus
                RUN apt-get install -y libc6-dev 
                RUN ln -s /usr/lib/libgdiplus.so/usr/lib/gdiplus.dll
                
                # copy csproj and restore as distinct layers
                WORKDIR /src
                COPY HelloWorld/HelloWorld.csproj HelloWorld/
                RUN dotnet restore HelloWorld/HelloWorld.csproj
                COPY . .
                
                
                WORKDIR /src/HelloWorld
                RUN dotnet build HelloWorld.csproj -c Release -o /app
                
                FROM build AS publish
                RUN dotnet publish HelloWorld.csproj -c Release -o /app
                
                FROM base AS final
                WORKDIR /app
                COPY --from=publish /app .
                ENTRYPOINT ["dotnet", "HelloWorld.dll"]
                

                即使我尝试了以下脚本来加载库,但仍然失败

                RUN apt-get update  
                    && apt-get install -y --allow-unauthenticated 
                     libc6-dev  
                    libgdiplus  
                    libx11-dev  
                    && rm -rf /var/lib/apt/lists/*
                

                错误

                 Connection id "0HLRJJEGNBH3R", Request id "0HLRJJEGNBH3R:00000001": An unhandled exception was thrown by the application.
                Aspose.Slides.PptxReadException: The type initializer for 'Gdip' threw an exception.
                 ---> System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
                 ---> System.DllNotFoundException: 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
                   at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
                

                推荐答案

                您在构建容器映像中安装 libgdiplus,但不是在最终容器映像中.您需要确保 libgdiplus 已安装在您的最终容器映像中.

                You're installing libgdiplus in your build container image, but not in your final container image. You need to make sure libgdiplus is installed in your final container image.

                您可以考虑像这样修改您的 Dockerfile:

                You can consider amending your Dockerfile like this:

                FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS base
                RUN apt-get update && apt-get install -y libgdiplus
                
                WORKDIR /app
                FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build
                [...]
                

                这篇关于无法加载共享库“libgdiplus"- Docker [带有 Aspose API 的 .NET 应用程序]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:在 ASP.NET Core 中构建 docker:“没有这样的文件或目录";错误 下一篇:在 Windows Server Core Docker 上安装 .NET Framework 3.5

                相关文章

                1. <small id='WCplF'></small><noframes id='WCplF'>

                2. <tfoot id='WCplF'></tfoot>

                    <i id='WCplF'><tr id='WCplF'><dt id='WCplF'><q id='WCplF'><span id='WCplF'><b id='WCplF'><form id='WCplF'><ins id='WCplF'></ins><ul id='WCplF'></ul><sub id='WCplF'></sub></form><legend id='WCplF'></legend><bdo id='WCplF'><pre id='WCplF'><center id='WCplF'></center></pre></bdo></b><th id='WCplF'></th></span></q></dt></tr></i><div id='WCplF'><tfoot id='WCplF'></tfoot><dl id='WCplF'><fieldset id='WCplF'></fieldset></dl></div>
                      <bdo id='WCplF'></bdo><ul id='WCplF'></ul>
                    <legend id='WCplF'><style id='WCplF'><dir id='WCplF'><q id='WCplF'></q></dir></style></legend>