Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This page outlines the solution deployment within Docker containers, focusing on Windows as the host container but applicable to Linux. It specifies system requirements, including Docker installation, Windows 10 64-bit specifications, Hyper-V, Containers features, and hardware prerequisites. The configuration procedure involves copying necessary runtime files and subfolders to Docker's temporary folder, managing license and argument files for project configuration, and creating a Dockerfile based on a .NET Framework image. Instructions for building and running the Docker image, with considerations for memory, CPU cores, and port settings for external access, are provided. The document is technical, targeting users familiar with Docker, and emphasizes a procedural approach for deploying applications in Docker environments.

On this page:

Table of Contents
maxLevel3
stylenone


Docker Tools

Framework projects can be deployed to run on Docker containers.

This Document assumes familiarity with Docker.

This page was created using Windows as host container (Docker Desktop WSL 2 backend), but equivalent steps can be used for any Linux with .Net 8 as host container.

Installation 

This is the procedure to install the Docker tools in a Windows computer. This page describe the use of the Docker tools in Windows, but the DockerFile created can target  either Windows, Linux, or any operating system compatible with .NET 8. 

1- Access the download link: Visit the Docker for Windows installation page.

2- Download: On the website, select the Docker Desktop for Windows (x86_64) option to download the latest version of Docker.

3 - Installation: After downloading, run the Docker Desktop Installer.exe file.

4 - Settings during installation:

  • During the installation process, you'll see a configuration screen.
  • Make sure to either check or uncheck the Use WSL 2 instead of Hyper-V option, depending on your preference:
    • WSL 2 (Windows Subsystem for Linux): This is the recommended option as it provides better performance and compatibility.
    • Hyper-V: If you prefer to use Hyper-V (for example, if you're already using it for other VMs), uncheck this option.

5 - Finish the installation: Complete the installation by following the on-screen instructions.

6 - Open Docker Desktop: After installation, open Docker Desktop from the Start Menu.

7 - Verify it’s working: When Docker Desktop opens for the first time, it will start automatically. You'll see a Docker icon in the system tray (next to the clock).

  • To verify if Docker is installed correctly, open PowerShell or Command Prompt and run the following command: docker --version

Additional Considerations:

1 - Make sure your machine has virtualization enabled in the BIOS/UEFI (required for both WSL 2 and Hyper-V).

2 - You can install WSL 2 directly via PowerShell with the following command if it's not yet configured: wsl --install


Configuration Procedure

Copying folders and Runtimes Files

After installing Docker and fx-10.0.0

System Requirements

To make use of this feature, the following system requirements need to be matched.

  • Install Docker.
  • Windows 10 64-bit: Pro, Enterprise, or Education (Build 17134 or later). For Windows 10 Home, see Install Docker Desktop on Windows Home.
  • Hyper-V and Containers Windows features must be enabled.
  • The following hardware prerequisites are required to successfully run Client Hyper-V on Windows 10:

Configuration Procedure

Copying Folders and Runtime Files

After installing Docker and fs-9.1.12, copy the files and subfolders from ”.. fs-9.1” to the Docker’s temporary folder, as in the image.

Docker folder filesImage Removed

In the image, the Bin is the temporary folder.

Not all files and subfolders are required, only the ones used in Runtime. The subfolders for DBProviders, Extensions, IoTand Templatesare not used in Runtime and do not need to be copied.

The HTML5 subfolder is only necessary if Web Clients will access pages from runtime. DevExpress and Sync- Fusion files are only necessary if Smart Clients will access displays from runtime.

Also, only the protocol drivers used by the project need to be copied (Ex: MODBUS.xml and T.ProtocolDriver.MODBUS.dll). The size of the image depends on which files will be used by the project.

The Project file (.tproj) and all other necessary files (e.g.: vc redist, etc) should also be copied to the temporary folder.

Copying License and Argument Files

“net8.0” (Path: fx-10/ net8.0) to a folder called “Bin” (the Bin folder should contain all the platform files from net8.0, including the solution.)  that you have created as in the image below:

Image Added



Copying License and Arguments Files

Create a folder called “Documents” in the same directory as the Dockerfile, after that create another folder called “FrameworX” inside “Documents” and inside the FrameworX directory, create the last folder called “MachineSettings.”

Inside MachineSettings, create a RemoteLicenseService.config fileCreate a RemoteLicenseService.config file and copy it to the temporary folder. The syntax is:

note
Code Block
RemoteServer=<IpAddress>:<PortNumber>
// IP:Port where the licensing server is Running RemoteServer=192.168.1.1:3100
10108

The port should point to the same port as your WebServices (TWebServices) running on the Server computer and you can check in the Server tab of Solutions Manager:

Image Added


The licensing server needs to have a license containing a Remote Licenses feature

.

:

License tab optionsImage Removed

Image Added


Create an Arguments.config file and copy it to the temporary Bin folder. The syntax is:

This
Code Block
/project:C:\App\<DockerTest>.tproj solution:/Bin/Solution.dbsln 	// ProjectSolution file name (mandatory)
/docker 				// (mandatory)
Note

/keepRunning

The file contains the parameters that will be passed to the

FactoryStudio

FrameworX modules (

TServer

TStartup and TRun-

Module). These parameters are the same ones used by the TStartup program.

Modules)


Creating the Docker File

Create a Dockerfile Docker file based on existent an existing image containing .NET Framework v4.6.2 or higher , (necessary required by FramworX). ExampleFrameworX). First of all, check your Windows edition by opening System Information and verifying the OS Name. Alternatively, you can open CMD and type “winver” to verify as well.

If you have Windows Pro or Enterprise, you can follow the example below:

Code Block
FROM mcr.microsoft.com/dotnet/framework/runtime 
WORKDIR /app
COPY bin .
RUN C:\app\vc_redist.x64.exe /quiet /install 
RUN C:\app\vc_redist.x86.exe /quiet /install
ENTRYPOINT ["TServer.exe", "/args:Arguments.config"]

Notes on this procedure:

  • Image from “microsoft.com/dotnet/framework/runtime” is used as the initial image.
  • In this example, all files from the temporary folder (Bin) will be copied to the “App“ folder (on image).
  • 3 VC redist files will be installed via the RUN command.
  • TServer will be executed using the parameters defined in the Arguments.config file.


Otherwise, if you have the Windows Home edition:

Code Block
FROM ubuntu:23.10
ARG DEBIAN_FRONTEND=noninteractive

# Update packages
RUN apt update
RUN apt-get install -y dotnet-runtime-8.0

COPY Bin /Bin
COPY Documents /Documents

// If you have the  Argument.config file
CMD ["dotnet", "/Bin/TStartup.dll", "/args:/Bin/Arguments.config"]

Notes on this procedure:

  • Starts creating the image based on the official Ubuntu 23.10 image.
  • Sets the DEBIAN_FRONTEND environment variable to noninteractive.
  • It updates the indexes of the available packages. This is done to ensure that the system has the latest information about the packages and can download the latest version of each one.
  • Installs the .NET 8.0 runtime in the container. The -y indicates that the command should automatically answer “yes” to any confirmation prompts that may appear during the installation.
  • Copies the Bin directory from the local system to the /Bin directory in the container.
  • Copies the Documents directory from the local system to the /Bin directory in the container.
  • Defines the default command that will be executed when the container starts.

To build the image, execute the following via the CMD command:

Code Block
docker build -t fs . // dot (.) IS IMPORTANT!!!

Command promptImage Removed

command in Command Prompt (CMD):

Info
titleBuilt Command, Attention to the Dot symbol

docker build -t fx . // dot (.) IS IMPORTANT!!!


Image Added


Image Added




Running the Image

 To run the image, execute the following via the CMD commandcommand in Command Prompt (CMD):

Code Block
docker run --memory=4096m --cpus=4 fs
//  -p 3101:3101 fx (Min Recommended 4 GB MemMemory and 4 CPU cores

//or specifying the port:
docker run -p 3101:3101 fs

Command promptImage Removed

Note

LocalIP is the IP of the Docker image (fs), and it can be used to access the runtime via external clients (Smart and Web) and debugging tools. To get access from other computers of intranet/internet to this docker image please contact your system administrator.

Info
titleDisplays Access

Locally (host computer) in Web Brower: http://localhost:3101/HTML5

Image Removed

Image Removed
)

Or just specifying the port: docker run -p 3101:3101 fx
If you want to name the container:
docker run --name <container_name>  -p 3101:3101 fx

Image Added



TRichClient Configuration

After running the container, go to fx-10 and create a shortcut for TRichClient.exe. Right-click on the TRichClient shortcut → Properties. In the target field, type your IP and the port where the solution is running in the container.

Code Block
"Path of TRichClient.exe" /ip1:<YOUR_IP>  /port1:<PORT>

To find your IP, open Command Prompt (CMD) and type ipconfig. Copy the IPv4 address from the Ethernet adapter vEthernet (WSL).

Once this is done, click Apply and close the Properties window. Then, click on the TRichClient Shortcut and wait for the solution to open.

Image Added


Image Added

Image Added



In this section...

Page Tree
root@parent
spacesV10