question

AbhishekPrajapati-9914 avatar image
0 Votes"
AbhishekPrajapati-9914 asked ·

How to add Fonts in azure container?

I have an application which I have deployed to Azure through docker image. Now I am facing one issue. This application sends an email with RDLC reports. But the reports I am getting in mail have different fonts than the report I am getting previously(without docker). I found that the base docker image mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 I am using does not have fonts loaded with it. I need to install fonts in my docker image/container. How can I do this?

Below is my Dockerfile commands:
FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019 AS BASE
COPY . .
ENTRYPOINT BackgroundService.exe

Thanks in advance

Abhishek Prajapati

azure-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ajkuma-MSFT avatar image
0 Votes"
ajkuma-MSFT answered ·

Welcome to Microsoft Q&A! Thanks for posting the question.

  • At the end of the Dockerfile, add the following line and save the file.

  • RUN ${source:-obj/Docker/publish/InstallFont.ps1}
    • InstallFont.ps1 is the file in the CustomFontSample project in the sample highlighted in the document, you may take a similar approach to install the font.

Additional for a reference, this example Docker File does the following:

Specifies a Long Term Servicing Channel base Windows Server 2019 Core image, i.e. mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019

Executes a PowerShell script to download and install the custom font within the container






· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Just checking in to see if the above post helped answer your question. Kindly let us know if you have any further questions on this specific topic, we would be more than happy to assist you.
Please do mark the post which was helpful by clicking on ‘Accept Answer’ & ‘Up-Vote’ to help the community find the right answers.

0 Votes 0 ·