Skip to main content
Bounty Ended with 100 reputation awarded by Levi Blodgett
added 55 characters in body
Source Link
harrymc
  • 1
  • 31
  • 579
  • 995

This problem is discussed in the bug-report
Unable to load DLL 'gdiplus.dll' when using Windows based docker images #1098 .

The explanation is that the base image you used does not contain System.Drawing.Common and the file gdiplus.dll.

You need a container that uses a ServerCore image (which apparently you did) and to add in the dotnet core runtime and aspnet core runtime.

Here is an example that uses for simplicity chocolatey to install them:

#
# This base image is to host dotnet core asp apps on servercore images 
# to better support things like GDI+ image manipulation or COM
#

FROM  mcr.microsoft.com/windows/servercore:1803
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

WORKDIR /app
RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
    choco install dotnetcore-runtime --version 2.2.7 -y; \
    choco install aspnetcore-runtimepackagestore --version 2.2.7 -y

ENV ASPNETCORE_URLS http://*:80
EXPOSE 80

Use the dotnet versions that match your base image.

This problem is discussed in the bug-report
Unable to load DLL 'gdiplus.dll' when using Windows based docker images #1098 .

The explanation is that the base image you used does not contain System.Drawing.Common and the file gdiplus.dll.

You need a container that uses a ServerCore image (which apparently you did) and to add in the dotnet core runtime and aspnet core runtime.

Here is an example that uses for simplicity chocolatey to install them:

#
# This base image is to host dotnet core asp apps on servercore images 
# to better support things like GDI+ image manipulation or COM
#

FROM  mcr.microsoft.com/windows/servercore:1803
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

WORKDIR /app
RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
    choco install dotnetcore-runtime --version 2.2.7 -y; \
    choco install aspnetcore-runtimepackagestore --version 2.2.7 -y

ENV ASPNETCORE_URLS http://*:80
EXPOSE 80

This problem is discussed in the bug-report
Unable to load DLL 'gdiplus.dll' when using Windows based docker images #1098 .

The explanation is that the base image you used does not contain System.Drawing.Common and the file gdiplus.dll.

You need a container that uses a ServerCore image (which apparently you did) and to add in the dotnet core runtime and aspnet core runtime.

Here is an example that uses for simplicity chocolatey to install them:

#
# This base image is to host dotnet core asp apps on servercore images 
# to better support things like GDI+ image manipulation or COM
#

FROM  mcr.microsoft.com/windows/servercore:1803
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

WORKDIR /app
RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
    choco install dotnetcore-runtime --version 2.2.7 -y; \
    choco install aspnetcore-runtimepackagestore --version 2.2.7 -y

ENV ASPNETCORE_URLS http://*:80
EXPOSE 80

Use the dotnet versions that match your base image.

Source Link
harrymc
  • 1
  • 31
  • 579
  • 995

This problem is discussed in the bug-report
Unable to load DLL 'gdiplus.dll' when using Windows based docker images #1098 .

The explanation is that the base image you used does not contain System.Drawing.Common and the file gdiplus.dll.

You need a container that uses a ServerCore image (which apparently you did) and to add in the dotnet core runtime and aspnet core runtime.

Here is an example that uses for simplicity chocolatey to install them:

#
# This base image is to host dotnet core asp apps on servercore images 
# to better support things like GDI+ image manipulation or COM
#

FROM  mcr.microsoft.com/windows/servercore:1803
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

WORKDIR /app
RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')); \
    choco install dotnetcore-runtime --version 2.2.7 -y; \
    choco install aspnetcore-runtimepackagestore --version 2.2.7 -y

ENV ASPNETCORE_URLS http://*:80
EXPOSE 80