How to add Fonts in azure container?

Abhishek Prajapati 1 Reputation point
2020-01-16T23:23:50.18+00:00

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 App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,913 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 22,416 Reputation points Microsoft Employee
    2020-01-17T20:11:34.617+00:00

    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