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:
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:
After successful build, unfold the container with a command:
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:
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.