Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libnice10 Debian package instead of bringing our own library #11

Closed
wants to merge 14 commits into from
36 changes: 17 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ ARG PKG_ARCH="armhf"
ARG PKG_ID="${PKG_NAME}_${PKG_VERSION}-${PKG_BUILD_NUMBER}_${PKG_ARCH}"
ARG PKG_DIR="/releases/${PKG_ID}"
ARG INSTALL_DIR="/opt/janus"
ARG LIBNICE_VERSION="0.1.18"
ARG LIBSRTP_VERSION="2.2.0"
ARG LIBWEBSOCKETS_VERSION="v3.2-stable"

Expand All @@ -22,37 +21,36 @@ RUN set -x && \

# Install general-purpose packages.
RUN apt-get install -y --no-install-recommends \
ca-certificates \
git \
wget \
python3-pip \
cmake \
pkg-config

# Install additional libnice dependency packages.
# Install dependencies for librtsp.
RUN apt-get install -y --no-install-recommends \
libglib2.0-dev \
libssl-dev \
ninja-build
libssl-dev

RUN pip3 install meson
# Install dependencies for libwebsockets.
RUN apt-get install -y --no-install-recommends \
zlib1g-dev

# Install additional Janus dependency packages.
RUN apt-get install -y --no-install-recommends \
automake \
gio-2.0 \
glib-2.0 \
libtool \
libjansson-dev \
libconfig-dev \
gengetopt

# libince is recommended to be installed from source because the version
# installed via apt is too low.
RUN git clone https://gitlab.freedesktop.org/libnice/libnice \
--branch "${LIBNICE_VERSION}" \
--single-branch && \
cd libnice && \
meson --prefix=/usr build && \
ninja -C build && \
ninja -C build install
# Install libnice from a custom package because the version in apt-get is too
# old.
ARG LIBNICE_PKG_URL="https://github.com/tiny-pilot/libnice-debian/releases/download/0.1.18-202211161620/libnice10_0.1.18-202211161620_armhf.deb"
RUN cd "$(mktemp --directory)" && \
wget "${LIBNICE_PKG_URL}" && \
dpkg --install *.deb

RUN wget "https://github.com/cisco/libsrtp/archive/v${LIBSRTP_VERSION}.tar.gz" && \
tar xfv "v${LIBSRTP_VERSION}.tar.gz" && \
Expand Down Expand Up @@ -155,7 +153,7 @@ RUN cp --parents --recursive --no-dereference "${INSTALL_DIR}/etc/janus" \
"${PKG_DIR}/"

# Add Janus compiled shared library dependencies to the Debian package.
RUN cp --parents --no-dereference /usr/lib/arm-linux-gnueabihf/libnice.so* \
RUN cp --parents --no-dereference \
/usr/lib/libsrtp2.so* \
/usr/lib/libwebsockets.so* \
"${PKG_DIR}/"
Expand All @@ -166,8 +164,8 @@ RUN cat > control <<EOF
Package: ${PKG_NAME}
Version: ${PKG_VERSION}
Maintainer: TinyPilot Support <support@tinypilotkvm.com>
Depends: libconfig9, libglib2.0-0, libjansson4, libssl1.1, libc6, libsystemd0
Conflicts: libnice10, libsrtp2-1, libwebsockets16
Depends: libconfig9, libglib2.0-0, libjansson4, libssl1.1, libc6, libsystemd0, libnice10 (>= 0.1.18)
Conflicts: libsrtp2-1, libwebsockets16
Architecture: ${PKG_ARCH}
Homepage: https://janus.conf.meetecho.com/
Description: An open source, general purpose, WebRTC server
Expand Down