How to create and launch a Docker container with TrueConf VideoSDK

Author4/4/24Writing DateAbout 7 minReading TimeAPI / SDKCategoryTrueConf SDKAPI / SDKTag

How to create and launch a Docker container with TrueConf VideoSDK

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.

  • Update the list of packages, to do it run this command in the terminal:
sudo apt update
  • Run this command to install additional packages required for working with remote repositories:
sudo apt -y install ca-certificates curl gnupg lsb-release
  • Download and add the PGP key from the Docker repository. To do it, run this command:
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  • Run this command to add a Docker repository:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  • Update the lists of available packages:
sudo apt update
  • Install Docker and additional packages with this command:
sudo apt -y install docker-ce docker-ce-cli containerd.io

Launch and automatic startup of Docker

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

sudo systemctl start docker

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

sudo systemctl enable docker

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:

groups $USER

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

sudo groupadd docker

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

sudo usermod -aG docker user_name

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

docker ps

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:

docker run hello-world

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:

docker run

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

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

Download Dockerfile

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:

docker build --build-arg username=sdkuser --build-arg password=123sdk456 -t tcvideosdk /home/$USER/dockerresources/videosdk

${**PARAM_NAME**:-**POSS_VAL**}

  • --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.

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

Testing build

Run the created container with this command:

docker run -it -d -p 2222:8080 -p 3333:8765 -p 4444:8766 tcvideosdk:latest

${**PARAM_NAME**:-**POSS_VAL**}

  • -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:

docker ps
alexadmin@DebDocker1:-5 dockerer run -it -d -p 2222:8080 -p 3333:8765 -p 4444:8766 tcvideosdk:latest f756fb106cedc657a51a90bad8996a03049e67d4a9402919e6b6b7aeada66ab4
alexadmin@DebDocker1:-5 docker ps
CONTAINER ID  IMAGE              COMMAND                 CREATED        STATUS        PORTS         NAMES
1756fb106ced  tcvideosdk:latest  "sh -c 'supervisord ."  9 seconds ago  Up 8 seconds  0.0.0.0:2222->8080/tcp, :::2222->8080/tcp,0.0.0.0:3333->8765/tcp, :::3333->8765/tcp, 0.0.0.0:4444->8766/tcp, :::4444->8766/tcp  affectionate_dewdney
alexadmin@DebDocker1:-5

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:

telnet localhost port

where port is the port that has to be checked.

alexadmin@DebDocker 1:~$ telnet localhost 3333
Trying ::1…
Connected to localhost.
Escape character is ']'.
Connection closed by foreign host.
alexadmin@DebDocker 1:~$ telnet localhost 4444
Trying : : 1.
Connected to localhost.
Escape character is
Connection closed by foreign host.

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

http://10.140.2.233:2222/public/default/config.json

This request should return the following data:

{"config":
  {"websocket":
    {"hostname":null,
    "port":8765},
  "http":
    {"hostname":null,
    "port":8766}
    }
  }