title: Unable to load shared library "libgdiplus" - Docker [ .NET application with Aspose API]
body: <p>The application is normally working with development environment when i create a docker file for deployment it getting failed with <strong>libgdiplus</strong> issue.</p>
  
  <p><strong>DockerFile</strong></p>
  
  <pre><code>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 &amp;&amp; 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"]
  </code></pre>
  
  <p><strong>Even i tried the below script to load library, but still it fails</strong></p>
  
  <pre><code>RUN apt-get update \ 
      &amp;&amp; apt-get install -y --allow-unauthenticated \
       libc6-dev \ 
      libgdiplus \ 
      libx11-dev \ 
      &amp;&amp; rm -rf /var/lib/apt/lists/*
  </code></pre>
  
  <p><strong>Error</strong></p>
  
  <pre><code> 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.
   ---&gt; System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
   ---&gt; 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&amp; token, StartupInput&amp; input, StartupOutput&amp; output)
  </code></pre>