@teguhmargaretha2010
Thank you for attaching your Dockerfile as it helped to find the root cause of this issue.
Solution
Replace in your Docker file the following line
RUN apt-get update && apt-get install -y libgdiplus
with
RUN apt-get update && apt-get install -y gnupg
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-buster main" >> /etc/apt/sources.list.d/mono-official-stable.list \
&& apt-get update \
&& apt-get install -y libgdiplus
that will install the latest stable version of libgdiplus
package.
The complete Dockerfile can be downloaded at Dockerfile.zip (840 Bytes)
Root cause
GroupDocs.Viewer heavily relies on System.Drawing.Common assembly that is using libgdiplus
under the hood. See more details at Install .NET on Debian - .NET | Microsoft Learn, quote:
For .NET Core apps that use the System.Drawing.Common assembly, you also need the following dependency:
- ibgdiplus (version 6.0.1 or later)
Unfortunately, the default apt repository contains an outdated version of libgdiplus
package. In this case it is 4.2-2
. This can be checked by running apt-get -s install libgdiplus
in a Docker container and the output would be similar to
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgdiplus is already the newest version (4.2-2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
When the required version is 6.0.1 or later. To install the latest version we need to add the repository with the latest build
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
&& echo "deb https://download.mono-project.com/repo/ubuntu stable-buster main" >> /etc/apt/sources.list.d/mono-official-stable.list
and after that install the latest version.
RUN apt-get update && apt-get install -y libgdiplus
Please let us know if it works for you.