manual docker install for gstreamer

Hey team,

I’m trying to setup Hailo on a docker container, for a robotics/ros2 project. My plan is to use a gst pipeline to stream the usb camera to a tcpsink, then inside the container consumer from that tcp, run inference, then pipe to another tcpsink that the host can get the output.

Host On my host machine (rpi5 running ubuntu), I have setup the hailo drivers and can see the device is registered with hailortcli fw-control identify

Docker This is my Dockerfile

`FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

— Install Python 3.11 and pip —

RUN apt-get update &&
apt-get install -y python3.11 python3.11-venv python3.11-dev python3-pip &&
ln -sf /usr/bin/python3.11 /usr/bin/python &&
ln -sf /usr/bin/python3.11 /usr/bin/python3

— Install all dependencies (build tools, gstreamer, opencv, etc) —

RUN apt-get update && apt-get install -y
sudo unzip curl wget build-essential lsb-release
python3-dev python3-setuptools python3-gi python3-gi-cairo python3-opencv python3-virtualenv
libgirepository1.0-dev python-gi-dev libcairo2-dev
libopencv-dev libzmq3-dev
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad libgstreamer-plugins-bad1.0-dev
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x
gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5
gstreamer1.0-pulseaudio rsync ffmpeg x11-utils vim
gcc-12 g+±12 cmake git
libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev libffi-dev
liblzma-dev libncurses5-dev libgdbm-dev tk-dev uuid-dev libnss3-dev
&& apt-get clean && rm -rf /var/lib/apt/lists/*

— Copy in setup files (models, debs, etc) —

COPY ./setup /tmp/setup

— Extract HailoRT runtime (change to _arm64.deb for ARM!) —

RUN mkdir -p /opt/hailo

— Environment for runtime —

ENV LD_LIBRARY_PATH=/opt/hailo/usr/lib
ENV PATH=$PATH:/opt/hailo/usr/bin
ENV CPLUS_INCLUDE_PATH=/opt/hailo/usr/include:/opt/hailo/usr/include/gstreamer-1.0/gst/hailo

WORKDIR /workspace

Optionally, copy in your models, .so files, test data, etc.

COPY ./models /workspace/models

COPY ./so /workspace/so

— Expose GStreamer ports —

EXPOSE 5000
EXPOSE 5001

Automate the install of some libs that need a running system to install

COPY setup/entrypoint-manual-install.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT [“/usr/local/bin/entrypoint.sh”]

CMD [“/bin/sh”, “-c”, “bash”]`

I’m using the entrypoint as a way to install the deb once the system is up, I saw on another post that you can’t do this as part of the docker build

`#!/bin/bash
set -e

export DEBIAN_FRONTEND=noninteractive

Optional: create state dir

mkdir -p /var/lib/hailo

Check if Hailo is installed

if ! dpkg -s hailort >/dev/null 2>&1; then
apt-get update

echo “:package: Installing Hailo-all”

— Extract HailoRT runtime (change to _arm64.deb for ARM!) —

dpkg-deb -x /tmp/setup/hailort_4.20.0_arm64.deb /opt/hailo

ln -s /opt/hailo/usr/bin/hailortcli /usr/bin/hailortcli && ln -s /opt/hailo/usr/lib/libhailort.so.4.20.0 /usr/lib/libhailort.so

— Unzip and install Tappas (3.31.0) —

unzip /tmp/setup/tappas_3.31.0_linux_installer.zip -d /tmp
cd /tmp/tappas_v3.31.0
mkdir hailort
git clone GitHub - hailo-ai/hailort: An open source light-weight and high performance inference framework for Hailo devices hailort/sources
chmod +x install.sh

the help for install says to use aarch64 but it’s wrong, it’ll fail on a sub script, use arm

./install.sh --skip-hailort --target-platform arm

echo “:white_check_mark: Hailo installation complete”
else
echo “:white_check_mark: Hailo already installed”
fi

Clear bash command cache to ensure new tools like hailortcli are found

hash -r

Pass control to CMD

exec “$@”
`

I downloaded hailort_4.20.0_arm64.deb and tappas_3.31.0_linux_installer.zip from the developer area on the Hailo website.

When I check for the hailonet plugin, it’s not installed

gst-inspect-1.0 hailonet
No such element or plugin 'hailonet'

However hailooverlay and hailofilter are present. Other than the hailort deb, and tappas linux installer, what else do I need to install?

thanks

Hey @james_elsey,

Welcome to the Hailo Community!

I’d recommend using this installation script: hailo-apps-infra/scripts/hailo_installer.sh at main · hailo-ai/hailo-apps-infra · GitHub

You’ll also need to install the driver separately. I’d suggest going with the tappas-core installation as well - it should give you a more stable setup.

Let me know if you run into any issues during the installation process!

Hi Omria, thanks for the reply.

I’m a little confused by all the different components, can you please help me understand?

I checked the hailo-apps-infra script you linked, and I see in the comments at the top it says:

#   - Downloads and installs the following:
#       * HailoRT driver deb
#       * HailoRT deb
#       * Tapas core deb
#       * HailoRT Python bindings whl
#       * Tapas core Python bindings whl

Does this mean that I don’t need to be installing the hailort deb and tappas linux installer in my container (as I posted above), I can drop those 2 lines and just run this script?

Thanks
James