Bengaluru Tech Summit 2024 on November 19-21 in India
Go back

How to create and launch a Docker container with TrueConf VideoSDK

June 18, 2024
Alexey Arkatov

Alexey Arkatov

Docker and its differences from a virtual machine

Docker is a software solution used for automatic deployment and management of applications in the environments that support containers. This solution makes it possible to “pack” an application with all its environment and dependencies in a container that may be later deployed. Docker offers a set of commands for managing these containers.

Docker and virtual machines have a similar purpose, but they interact with the operating system in different ways. The main distinction is that a virtual machine offers an additional abstraction layer over the real hardware and drivers while a Docker container directly interacts with the hardware of the host machine.

What is TrueConf VideoSDK?

TrueConf VideoSDK is a software solution for creating enterprise-level applications with integrated TrueConf video conferencing. It serves as the basis for TrueConf Room which means that TrueConf Room can be viewed as TrueConf VideoSDK with a full-featured web interface for managing video conferences. Check here to learn more about TrueConf VideoSDK and its differences from TrueConf Room. TrueConf also provides a NuGet package to support .NET development. To learn more about this package, check here.

This toolkit helps developers create high-quality applications and facilitates the development process. With TrueConf VideoSDK, one can integrate video conferencing technologies into self-service or information kiosks and enterprise-based software.

Limitations of TrueConf VideoSDK within a container

The features of VideoSDK on a local machine and within a container are almost identical. The only difference is that the latter does not have Front-End. In other words, the main application screen and the conference layout cannot be displayed on a monitor. This issue is related to the restrictions imposed by containers.

How to deploy a container with VideoSDK on my PC

This example will show how to install and configure Docker and deploy a container on Debian 12. The content of the container will be TrueConf VideoSDK version 4.3.

To install Docker on your OS:

  1. Update the list of packages, to do it run this command in the terminal:
  2. Run this command to install additional packages required for working with remote repositories:
  3. Download and add the PGP key from the Docker repository. To do it, run this command:
  4. Run this command to add a Docker repository:
  5. Update the lists of available packages:
  6. Install Docker and additional packages with this command:

Launch and automatic startup of Docker

By default, Docker is disabled after installation. To launch it, run this command:

To add Docker to the automatic startup, execute the command:

Adding a user to a Docker group

By default, Docker is available only to the root user: if a Docker command is run by a regular user, an error message will be displayed in the terminal. To run Docker commands on behalf of a regular user without the sudo command, one should add the current user to the docker group which is created automatically during installation. Run this command to check if the group is available:

If this group was not created automatically due to some reason, one has to create it manually. To do it, run this command:

Next, to add the current user to the docker group, execute the command:

, where user_name is the name of the user who should be added to the docker group. To check the result, execute the command:

This command displays the list of launched containers.

Launching the first container

To make sure that Docker was installed correctly, mount a test image. For this purpose, execute the command:

This command will mount the program image from the Docker hub online repository (official Docker registry of software images which is used by default) and run it automatically. If Docker was installed and configured correctly, the phrase “Hello from Docker” will be displayed.

How to build a container with VideoSDK

Building a container

A container is created at the time of its launch. These processes are started with the command:

The utility program has to be given the image on the basis of which the container will be created as well as the Dockerfile, the configuration file that will include the instructions for creating the image. The image can be either local (stored on the computer) or point to the image that should be downloaded from the network (Docker hub and others). In this case, the image stored locally will be used.

Download VideoSDK from our GitHub; please note that the option with Ubuntu 22.04 has to be selected.

Download VideoSDK

Click on the button below to download the archive with the Dockerfile.

Download Dockerfile

One should keep in mind that by default the processes within the container work on behalf of the root user, however, it is dangerous to work under the root account because this user cannot be restricted in any way. To make sure that no threats are posed to the local machine from inside the container, you need to create a user with the standard set of permissions when building the container.

In this example, Dockerfile and VideoSDK image are in the same directory (/home/$USER/dockerresources/videosdk); otherwise, you need to specify the Dockerfile directory with the -f flag.The command for creating the container with VideoSDK will look in the following way:

where:

  • --build-arg username=sdkuser — user name;
  • --build-arg password=123sdk456 — user password;
  • -t tcvideosdk — image name;
  • /home/$USER/dockerresources/videosdk — path to the folder with the Dockerfile and container image.

After the command is executed, the container will start to be built. Information about this entire process will be displayed in the terminal. When build is complete, the following message will be displayed:

[+] Building 1169.1s (12/12) FINISHED.

Testing build

Run the created container with this command:

where:

  • -it — connects the interactive tty terminal to the container;
  • -d — launches the container in the background;
  • -p 3333:8765 -p 4444:8766 tcvideosdk:latest — sets the ports for a Web socket and http port.

To display the list of launched containers in the terminal, run this command:

As it is shown in the screenshot above, the container has been launched successfully, and is displayed in the terminal. Check the availability of 3333 and 4444 ports with this command:

where port is the port that has to be checked.

The message “Connected to localhost” is displayed in the terminal, which means that the port is working.

To test the http port and Web socket, make an http request:

This request should return the following data:


Still have questions? Please contact our support team directly via online chat.

Sign up for newsletter