We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Failing while building docker image Fonts are not available

I am using jdk 11 & I am trying to build a docker image with amazoncorretto, I am getting java.lang.NoClassDefFoundError: Could not initialize class com.aspose.cells.b.a.b.zh while generating Excel. It might be due to Fonts that are not available as part of the docker image.
So how can I resolve this issue?
And what are all the fonts that I need to add to the docker file?


Your issue might be related to configurations on your end, so go through the topic for your reference.

Moreover, please see and follow the guidelines on how to use/run Aspose.Cells in docker for your complete reference.

Hi! @Amjad_Sahi,
I am trying to build the docker image, amazoncorretto:11-alpine-jdk, so while building it is asking to fonts folder for aspose cells and aspose slides.
Because of this build is failing.
So please can you help me, from where I can get the fonts folder while builder docker image.
thanks! @Amjad_Sahi

Hi @Rohan_Wankar
So are you building the docker image with a dockerfile? And the build is failing when you are running the dockerfile?
Can you share your dockerfile please and Provide more details, such as the error message when building it?

In the sample dockerfile we provided, we have a script that looks like this:

COPY fonts/* /usr/share/fonts/

The “font” folder is in your local path, put font files in it, and copy them to docker image.

hi! @leoluo
thanks for the quick response, but where I can download all the required fonts.
And have it as part of our folder.
Could you help us with this?



You need to have or copy fonts yourselves (you may get from online or other sources) in your local fonts folder as recommended. The SDK image would contain very few fonts or limited sets of fonts. Moreover, you may even copy all the necessary fonts (especially used in your workbooks) from other sources, e.g., from Windows (os) fonts folder.

Thanks @Amjad_Sahi for your reply. Could you please provide us with a URL which you would recommend to download the required fonts please?
It will be really helpful!

Hi @Rohan_Wankar @Thilakbabu
Please refer to this plan:

Run this command in docker file:
RUN apt-get update; apt-get install -y fontconfig libfreetype6

If still have any issue, please share your dockerfile, thanks.