FastReports / FastReport

Free Open Source Reporting tool for .NET6/.NET Core/.NET Framework that helps your application generate document-like reports
https://www.fast-report.com
MIT License
2.62k stars 582 forks source link

Container Linux Docker Net 7.0 #702

Open tiagovbp opened 3 weeks ago

tiagovbp commented 3 weeks ago

I'm testing Container Linux, and when I go up and try to test my application, it gives the following error with FastReport in the report.Prepare() step;

image image

"Exception in BuildFontRuns() with original length of 35 now 35, style run count 1, font run count 0, direction overrides: False.

Small part of the dockerfile

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base WORKDIR /app

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base RUN apt-get update \ && apt-get install -y wget \ && rm -rf /var/lib/apt/lists/ RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula \ select true | debconf-set-selections RUN apt-get update \ && wget http://ftp.fr.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.8_all.deb -P /Downloads \ && apt-get install -y /Downloads/ttf-mscorefonts-installer_3.8_all.deb \ && rm /Downloads/ttf-mscorefonts-installer_3.8_all.deb \ && rm -rf /var/lib/apt/lists/ WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src

Some help?

BogdanStegachev commented 3 weeks ago

Hello!

Here is an example of a correct Dockerfile:

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
RUN apt-get update \
    && apt-get install -y wget \
    && rm -rf /var/lib/apt/lists/*
RUN echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula \
    select true | debconf-set-selections
RUN apt-get update \
    && wget http://ftp.fr.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.8_all.deb -P /Downloads \
    && apt-get install -y /Downloads/ttf-mscorefonts-installer_3.8_all.deb \
    && rm /Downloads/ttf-mscorefonts-installer_3.8_all.deb \
    && rm -rf /var/lib/apt/lists/*
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["FastReportSkia/FastReportSkia.csproj", "FastReportSkia/"]
RUN dotnet restore "./FastReportSkia/FastReportSkia.csproj"
COPY . .
WORKDIR "/src/FastReportSkia"
RUN dotnet build "./FastReportSkia.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./FastReportSkia.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "FastReportSkia.dll"]

Best regards, Bogdan

tiagovbp commented 3 weeks ago

Hi @BogdanStegachev , unfortunately that's not my problem. =(

tiagovbp commented 3 weeks ago

"Exception in BuildFontRuns() with original length of 35 now 35, style run count 1, font run count 0, direction overrides: False."

BogdanStegachev commented 3 weeks ago

I am sending you a test application using FastReport.Core.Skia Demo version 2024.2.9 and Docker below

Application: https://drive.google.com/file/d/1FOxqLbEIa28Kl9El9EDbYEH90hkgtA_R/view?usp=sharing

Best regards, Bogdan

tiagovbp commented 3 weeks ago

It worked correctly. The only question that is marked as "DEMO".

Do you know of any free solutions? Or just buying the license itself?

Thanks @BogdanStegachev

BogdanStegachev commented 3 weeks ago

Hello!

You will also be able to add libgdiplus installation and follow the test Dockerfile above to solve your problem, I send you an example of installing libgdiplus in Dockerfile :

RUN ln -s /lib/x86_64-linux-gnu/libdl-2.24.so /lib/x86_64-linux-gnu/libdl.so
RUN apt-get update \
 && apt-get install -y --allow-unauthenticated \
 libc6-dev \
 libgdiplus \
 libx11-dev
 && rm -rf /var/lib/apt/lists/*
ENV DISPLAY :99

Best regards, Bogdan