Created
March 14, 2023 21:15
-
-
Save migueloliveiradev/ea0ca7c61289c9f16c82fdcec13e2005 to your computer and use it in GitHub Desktop.
Fixing System.TypeInitializationException: The type initializer for 'Gdip' threw an exception.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/dotnet/sdk:6.0 as build-env | |
WORKDIR /src | |
COPY ./WebApplication2/WebApplication2/* . | |
RUN dotnet restore | |
COPY ./WebApplication2/ . | |
RUN dotnet publish -c Release -o /publish | |
FROM mcr.microsoft.com/dotnet/aspnet:6.0 as runtime | |
#the libgdiplus download must be done in the aspnet runtime. | |
RUN apt-get update -y && \ | |
apt-get upgrade -y && \ | |
apt-get install libgdiplus -y && \ | |
apt-get clean -y | |
WORKDIR /publish | |
COPY --from=build-env /publish . | |
ENTRYPOINT ["dotnet", "WebApplication2.dll"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment