logo
small logo
  • Products
  • Buy
  • Support
  • About
  • Customer panel Support
    • en
    • de
    • JP
    • ZH
  • Home
  • /
  • Articles
  • /
  • Application with FastReport .NET in Docker with Linux
  • Building libgdiplus library from source

    October 2, 2020

    When using the FastReport.NET (Core), FastReport Open Source and FastReport Mono libraries on Linux operating

    read more
  • The era of WinForms is over, the era of FastReport.Core.Skia began

    September 6, 2022

    To create high-quality reports and correctly export them to different formats (PDF, Word, Excel, etc.),

    read more
  • How to make PDF on Raspberry PI with .NET Core

    May 26, 2020

    Raspberry PI is a miniature single-board computer with ARM processor. This microcomputer is often used

    read more
  • Reporting with PostgreSQL in a .NET 5 application for Debian 10

    May 25, 2022

    Many need a solution that will generate reports for Linux systems, and support working

    read more
  • Reports and PDF documents in Blazor

    April 5, 2021

    Microsoft has recently launched a web platform called Blazor. This framework allows creating an interactive

    read more

Application with FastReport .NET in Docker with Linux

November 17, 2021

Docker is a software platform for rapid development, testing and launching of applications. Due to it, one may locate multiple containers on one server. The containers are understood as integrity of our application, its dependences, and image. One should remember that an image is a template which represents a cast of a file system. As we have recollected a number of terms, we may speak of how to boost FastReport.Core + FastReport.Web in our container.

First, we need to install Docker onto any Linux distributive, in our case Ubuntu 20.04. On installing Docker with Linux you may read this article. After installing and checking, you may proceed to the next step.

Now we have to create DockerFile. It is an ordinary text document containing all commands for building an image. You may build and edit this file both in an ordinary word processor or in VS code. By the way, VS code has a convenient docker plug-in, which to some extent simplifies coding and editing.

An example of DockerFile:

FROM microsoft/dotnet:2.1-aspnetcore-runtime AS base
WORKDIR /app
 
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
 
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY ["fastreport_net", "FastReport.Net"]
RUN dotnet restore "FastReport.Net/Demos/Core/FastReport.Core.Web21.MVC/FastReport.Core.Web21.MVC.csproj"
COPY . .
WORKDIR "/src/FastReport.Net/Demos/Core/FastReport.Core.Web21.MVC"
RUN dotnet build "FastReport.Core.Web21.MVC.csproj" -c Release -o /app
 
FROM build AS publish
RUN dotnet publish "FastReport.Core.Web21.MVC.csproj" -c Release -o /app
 
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "FastReport.Core.Web21.MVC.dll"]
 

This docker file unfolds the image of a Demo application of FastReport.Core.Web21.MVC, which uses FastReport.Web and FastReport.Core. You may try it yourself in the next link, or find a directory Demos\Core\FastReport.Core.Web21.MVC when downloading FastReport.NET.

After writing DockerFile you must build it. It is very simple. Start a terminal from the directory which DockerFile is located in, and write the command into it:

sudo docker build

After successful build, unfold the container with a command:

sudo docker run -d -p 8080:80 build/fastreport 

In this command we forward port 8080 and name the image as “build/fastreport”.

After the successful start of the container, we open http://localhost:8080/. Then we transfer to the page of our application; if all dependences were executed and resolved, then we will see our project:

Ready project

To sum it up, Docker executes unfolding with literally two commands, while containers take much less space than the virtual machine images, which saves a lot of time and space.

about product buy
avatar
Marat Alaev
QA
Fast Reports Team: Marat Alaev - Quality Assurance at Fast Reports
.NET FastReport Linux Core Libgdiplus Ubuntu

Add comment
logo
  • 800-985-8986 (English, US)
  • +4930568373928 (German)
  • +55 19 98147-8148 (Portuguese)
  • info@fast-report.com
  • 901 N Pitt Str #325 Alexandria VA 22314
  • Buy
  • Download
  • Documentation
  • Testimonials
  • How to uninstall
  • FAQ
  • Tutorial Video
  • Forum
  • Articles
  • Our News
  • Press about us
  • Resellers
  • Extended licensing
  • Contact us

© 1998-2023 by Fast Reports Inc.

  • Privacy Policy