OrbbecSDK_v2

OrbbecSDK Docker Environment Setup

Installing Docker

For Overseas Users:

Refer to the official Docker documentation.

For Users in China:

Refer to the Tsinghua University Open Source Software Mirror.

Uninstall Previous Docker Installations:

If you have previously installed Docker, remove it first:

sudo apt-get remove docker docker-engine docker.io containerd runc

Install Dependencies:

sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

Trust Docker’s GPG Key:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Add Docker Repository:

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

Install Docker:

sudo apt-get update
sudo apt-get install docker-ce

Add Current User to Docker Group:

To avoid using sudo for Docker commands, add your user to the Docker group:

sudo groupadd docker
sudo usermod -aG docker $USER

You will need to log out or reboot for this to take effect.

Installing NVIDIA Docker

Refer to the official NVIDIA documentation.

Getting Started

Install ADE CLI

Go to the ADE CLI releases page and download the latest version for your system.

mv ade+x86_64 ade
# or mv ade+aarch64 ade
chmod +x ade
sudo mv ade /usr/local/bin

Shell Completion

Add the following code to your .zshrc or .bashrc:

if [ -n "$ZSH_VERSION" ]; then
    eval "$(_ADE_COMPLETE=source_zsh ade)"
else
    eval "$(_ADE_COMPLETE=source ade)"
fi

Build Docker

./build_docker.sh

Usage

Choose Directory to Mount (e.g., ~/ws):

cd ~/ws
touch .adehome

This indicates that Docker will mount ~/ws as the container’s home directory. You can also mount other directories.

Set Up .aderc:

cd ~/ws
touch .aderc

Add the following to .aderc:

export ADE_DOCKER_RUN_ARGS="--cap-add=SYS_PTRACE \
 --privileged \
 --net=host \
 --add-host ade:127.0.0.1 \
 -v ${HOME}/.Xauthority:${HOME}/.Xauthority:ro \
 -e XAUTHORITY=${HOME}/.Xauthority \
 -v /dev:/dev \
"

export ADE_IMAGES=" \
 orbbecsdk-env:x86_64_20240711 \
"

Start Container:

Navigate to the directory containing .aderc:

ade start
ade enter

You should now be inside the Docker container.

References

  1. Docker Documentation
  2. NVIDIA Container Toolkit Installation Guide
  3. ADE CLI Documentation