telerik reporting .net 5.0 docker support

2 Answers 402 Views
.NET 5 .NET Core Rendering
Robert
Top achievements
Rank 1
Robert asked on 07 Jun 2021, 01:49 PM
Hi,

I upgraded from .net  3.1 to .net 5.0 ..

When i start program locally everything works (rendering etc, i have result and base64 string of pdf)  but inside docker it is not working ..

Do you have any ideas ? I pasted dockerfile

#FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine  AS build
FROM mcr.microsoft.com/dotnet/sdk:5.0  AS build
ARG APP_ENV=omtest1

#app run environment
ENV APP_ENV $APP_ENV

WORKDIR /src

COPY test/*.csproj test/
COPY telerik/*.csproj telerik/
#COPY WorkerService3/*.csproj WorkerService3/
RUN dotnet restore  test/test.csproj

# copy and build app and libraries
COPY  test/  test/
COPY  telerik/ telerik/
#COPY  WorkerService3/ WorkerService3/

WORKDIR /src/test
RUN dotnet build -c release

#app ports to be exposed
EXPOSE 5000
EXPOSE 2000

FROM build AS publish
RUN dotnet publish -r linux-x64 -o /app/publish

# final stage/image
#FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine
FROM centos:7.5.1804
#FROM mcr.microsoft.com/dotnet/sdk:5.0
RUN 		yum install wget -y && \
	yum install -y epel-release && \
	rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm && \	
	yum install glibc-devel -y && \
        yum install -y libgdiplus-2.10-10.el7.x86_64 && \
        yum install libX11-devel -y && \
	yum install dotnet-sdk-5.0 -y && \	
        rm -rf /var/cache/yum 
WORKDIR /app/telerik
EXPOSE 2000
COPY --from=publish /app/publish .

ENV ASPNETCORE_URLS http://*:2000
RUN cd /app/telerik &&  \
    cp te36013t_0.ttf TeleNeo-Regular.otf TeleNeo-Bold.otf TeleGroteskNor_0.ttf te36016t_0.ttf ConnectCode39_0.ttf /usr/share/fonts/
CMD dotnet test.dll --environment development


2 Answers, 1 is accepted

Sort by
0
Accepted
Bob
Top achievements
Rank 1
Iron
answered on 08 Mar 2022, 01:33 PM

Hi Dimitar - yes the problem has been resolved.

The issue ended up being the connection string I was using for development - when testing the example reports that came with the Reporting server within a container, hosted for development in Docker Desktop.   The example connection string name has dots (.) in it which were not being recognized in the docker-componse.override.yml.  I simply replaced the name with all the dots with a string that could easily be using in the docker-compose yaml file.

replaced:   Telerik.Reporting.Examples.CSharp.Properties.Settings.TelerikConnectionString
with:  ReportingExamplesConnectionString


Dimitar
Telerik team
commented on 08 Mar 2022, 03:19 PM

Hi Bob,

Thank you for sharing the solution here!

Regards,

Dimitar

 

-1
Plamen Mitrev
Telerik team
answered on 08 Jun 2021, 01:02 PM

Hello Robert,

Thank you for contacting us with this question about Telerik Reporting in a Docker image and I will happily answer it and share more details.

Telerik Reporting can be used in a Docker image, as long as it meets the GDI+ requirements. Please make sure that the libgdiplus library is installed properly, as described in Containerize Telerik Reporting section. That should resolve the issue you encountered.

Test the above suggestions on your end and let me know if you need further assistance, or encounter any troubles.

Regards,
Plamen Mitrev
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Robert
Top achievements
Rank 1
commented on 08 Jun 2021, 01:12 PM

Hi Plamen !
tnx for you quick answer...

libgdiplus is installed..
when i change sdk from 3.1 --> 5.0 rendering does not working..

please check the dockerfile i attached
Plamen Mitrev
Telerik team
commented on 09 Jun 2021, 01:13 PM

Hi Robert, I see that you have opened a support ticket as well. We discussed it with my colleague and she already replied there. Since this issue will require some additional information and logs, we can continue this discussion in the support ticket. 

Thank you for your cooperation and understanding.

Bob
Top achievements
Rank 1
Iron
commented on 03 Mar 2022, 09:47 PM | edited

UPDATE:  set my SQL connection strings, restarted the app and it works now.   I'm guessing my container wasn't updated before with the changes I made to my dockerfile... ?

Was this resolved?  Please post here so I can benefit from the resolution.  I'm hosting the report service in a docker container (docker desktop).

Environment:  aspnet core 6.0
Telerik.Reporting.Services.AspNetCore.Trial - version 16.0.22.225

 

I've installed required packages:

RUN apt-get update && apt-get install -y libc6-dev libgdiplus libx11-dev && rm -rf /var/lib/apt/lists/*

But, get the following exception when loading one of the sample reports (of course it works fine in windows):

 

REQUEST:
https://localhost:44384/api/reports/clients/6d7a5e1a419/parameters
payload - {"report":"Invoice.trdp","parameterValues":{}}

RESPONSE:
{message: "An error has occurred.",…}  exceptionMessage:
 "Type: Telerik.Reporting.ReportSerialization.Current.ReportSerializable`1[Telerik.Reporting.Report]"

exceptionTypenull
message"An error has occurred."
stackTracenull

Dimitar
Telerik team
commented on 08 Mar 2022, 12:04 PM

If I understand correctly, based on the UPDATE statement, the problem has now been resolved for you, is that correct?

If the problem is still present, this issue could be related to the fonts used by the report that you are trying to render in the docker container. I recommend you to go over  The type initializer for 'Telerik.Reporting.Processing.Common.FontContainer' threw an exception KB article and please test the suggested solution.

Tags
.NET 5 .NET Core Rendering
Asked by
Robert
Top achievements
Rank 1
Answers by
Bob
Top achievements
Rank 1
Iron
Plamen Mitrev
Telerik team
Share this question
or