Hello,
I’m running (or rather try to run) GroupDocs in docker container. Everythings works fine on my local (windows) machine but inside docker image I’m receiving various exceptions.
For images:
GroupDocs.Conversion.Exceptions.CorruptOrDamagedFileException: Cannot convert. The file is corrupt or damaged.
at♣♥.☻()
at GroupDocs.Conversion.Converter.☻()
For pptx
GroupDocs.Conversion.Exceptions.GroupDocsConversionException: The type initializer for 'Gdip' threw an exception.
at♣♥.☻()
at GroupDocs.Conversion.Converter.☻()
at GroupDocs.Conversion.Converter.Convert(SaveDocumentStream document, ConvertOptions convertOptions)
My packages (I’ve tried various versions of SkiaSharp):
<PackageReference Include="GroupDocs.Conversion" Version="22.5.0" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.80.4" />
My docker file contains installation from documentation:
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /source
COPY *.csproj .
RUN dotnet restore --verbosity q
COPY . .
RUN dotnet publish DocumentProcessing.POC.csproj --no-restore --configuration Release -o /app
FROM mcr.microsoft.com/dotnet/aspnet:6.0-jammy AS final
WORKDIR /app
COPY --from=build /app .
# begin install libgdiplus and dependencies
RUN apt-get update \
&& apt-get install -y \
apt-transport-https \
dirmngr \
gnupg \
ca-certificates
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-focal main" | tee /etc/apt/sources.list.d/mono-official-stable.list \
apt update
RUN apt-get update \
&& apt-get install -y --allow-unauthenticated \
libc6-dev \
ffmpeg \
libgdiplus \
libx11-dev
# end install libgdiplus and dependencies
# begin ttf-mscorefonts-installer
RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections \
&& apt-get update \
&& apt-get install -y \
libfontconfig1 \
xfonts-utils \
ttf-mscorefonts-installer fontconfig
# end ttf-mscorefonts-installer
ENTRYPOINT ["dotnet", "DocumentProcessing.POC.dll"]