Skip to content

UT Core Building using Docker or Vagrant

Ulrond edited this page Apr 10, 2025 · 4 revisions

Problem

It has been reported that the ut-core building process encounters a zstd dependency issue when configuring cURL. While this issue is commonly observed on Linux PCs, users can easily bypass it by using Docker or Vagrant to build ut-core in a controlled environment.

This page provides detailed installation instructions for Docker and Vagrant, along with a basic script to install essential packages required for ut-core.

Install procedure for docker

Install Docker

sudo apt update && sudo apt upgrade -y
sudo apt install -y ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \`
`$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

docker --version

Pull the Ubuntu 22.04 Docker Image

sudo docker pull ubuntu:22.04
sudo docker images

Steps to access Files from Docker to Your PC and vice versa

mkdir -p /host/data
cp install.sh to /host/data/.
chmod +x /host/data/install.sh

Run Docker

sudo docker run -it -v /host/data:/container/data ubuntu:22.04

once inside docker:

cd  /container/data

run install script:

./install.sh

generate ssh keys and add the public key to rdkcentral

git clone <repo url>

copy the binary and libraries generated to /container/data and the same will be available

to you in /host/data of your PC.

Note: Every time you will need to do this install and other procedure on docker unlike vagrant, as vagrant is virtual box and docker isn't, its just a container to do your work and exit

Install procedure for vagrant

Install Virtualbox for vagrant

sudo apt update && sudo apt upgrade -y
sudo apt install virtualbox -y
VBoxManage --version

Install vagrant

wget -O - https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vagrant
vagrant --help
vagrant --version

create vagrant environment

mkdir vagrant-ubuntu2204
cd vagrant-ubuntu2204
vagrant init generic/ubuntu2204
mv Vagrantfile Vagrantfile_orig

 
cat Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.box = "generic/ubuntu2204"
  config.vm.network "private_network", type: "dhcp"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024" # Reduce memory
    vb.cpus = 1        # Use fewer CPUs
  end
end

start using vagrant

vagrant up; vagrant ssh

=> You should see the prompt like this:

Last login: Wed Jan 22 14:22:43 2025 from 10.0.2.2
vagrant@ubuntu2204:~$

Script for installing basic packages for ut-core

cat install.sh 
#!/bin/bash

# Update package list
echo "Updating package list..."
apt-get update -y

# Install required packages
echo "Installing required packages..."
apt-get install -y \
    file \
    git \
    gcc \
    g++ \
    zip \
    bzip2 \
    tar \
    libssl-dev \
    cmake \
    make \
    wget

# Verify installation of packages
echo "Verifying installed packages..."
file --version
git --version
gcc --version
g++ --version
zip --version
bzip2 --version
tar --version
cmake --version
make --version
wget --version

echo "All packages installed successfully!"
Clone this wiki locally