From f3420486978ac6e9d3e34c1d61cdff73457e7e50 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 08:19:06 -0500 Subject: [PATCH 01/11] Use libnice10 Debian package instead of bringing our own library --- Dockerfile | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index cffae0c..ad00f43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" @@ -28,14 +27,6 @@ RUN apt-get install -y --no-install-recommends \ cmake \ pkg-config -# Install additional libnice dependency packages. -RUN apt-get install -y --no-install-recommends \ - libglib2.0-dev \ - libssl-dev \ - ninja-build - -RUN pip3 install meson - # Install additional Janus dependency packages. RUN apt-get install -y --no-install-recommends \ automake \ @@ -44,15 +35,12 @@ RUN apt-get install -y --no-install-recommends \ 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. +# TODO: Replace with real URL. +ARG LIBNICE_PKG_URL="https://p.tinypilotkvm.com/!Xu2Ex6oQoE/libnice10_0.1.18-20221116_armhf.deb" +RUN wget "LIBNICE_PKG_URL" --output-document="libnice.deb" && \ + dpkg --install libnice.deb RUN wget "https://github.com/cisco/libsrtp/archive/v${LIBSRTP_VERSION}.tar.gz" && \ tar xfv "v${LIBSRTP_VERSION}.tar.gz" && \ @@ -155,7 +143,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}/" @@ -166,8 +154,8 @@ RUN cat > control < -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 From 0ea97f5128bf3902332ffd36caa6ad05ed4c30f9 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 08:30:42 -0500 Subject: [PATCH 02/11] Fix environment variable --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ad00f43..0842ceb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,7 +39,7 @@ RUN apt-get install -y --no-install-recommends \ # old. # TODO: Replace with real URL. ARG LIBNICE_PKG_URL="https://p.tinypilotkvm.com/!Xu2Ex6oQoE/libnice10_0.1.18-20221116_armhf.deb" -RUN wget "LIBNICE_PKG_URL" --output-document="libnice.deb" && \ +RUN wget "${LIBNICE_PKG_URL}" --output-document="libnice.deb" && \ dpkg --install libnice.deb RUN wget "https://github.com/cisco/libsrtp/archive/v${LIBSRTP_VERSION}.tar.gz" && \ From 98edf1abafc7372fe6275da51c870a754ddf439a Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 09:06:20 -0500 Subject: [PATCH 03/11] Add libssl-dev --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index 0842ceb..5b579a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get install -y --no-install-recommends \ wget \ python3-pip \ cmake \ + libssl-dev \ pkg-config # Install additional Janus dependency packages. From 8067049fedb24361e6b3251fadce652f6a36015c Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 09:15:29 -0500 Subject: [PATCH 04/11] Use Docker build --progress=plain for better logging in CircleCI --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7fa580..5abbb77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,6 +50,7 @@ jobs: --build-arg PKG_VERSION \ --build-arg "PKG_BUILD_NUMBER=$(date '+%Y%m%d')" \ --target=artifact \ + --progress=plain \ --output type=local,dest=$(pwd)/releases/ \ . - run: From 9e1af4c9b6278ff4620e03ceae32b971066cc960 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 09:23:02 -0500 Subject: [PATCH 05/11] Update dependencies --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5b579a6..cb5653b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,11 +23,17 @@ RUN set -x && \ RUN apt-get install -y --no-install-recommends \ git \ wget \ - python3-pip \ cmake \ - libssl-dev \ pkg-config +# Install dependencies for librtsp. +RUN apt-get install -y --no-install-recommends \ + libssl-dev + +# 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 \ From 3800ac1e09356bae84b2295d00e90c88283da457 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 09:28:29 -0500 Subject: [PATCH 06/11] Use ca-certificates --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index cb5653b..33b2401 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ RUN set -x && \ # Install general-purpose packages. RUN apt-get install -y --no-install-recommends \ + ca-certificates \ git \ wget \ cmake \ From 81bffefbb1b4c0d4590d8ac3343c387edcf99f75 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 09:38:30 -0500 Subject: [PATCH 07/11] Use production URL for libnice package --- Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 33b2401..cdf0648 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,8 +45,7 @@ RUN apt-get install -y --no-install-recommends \ # Install libnice from a custom package because the version in apt-get is too # old. -# TODO: Replace with real URL. -ARG LIBNICE_PKG_URL="https://p.tinypilotkvm.com/!Xu2Ex6oQoE/libnice10_0.1.18-20221116_armhf.deb" +ARG LIBNICE_PKG_URL="https://github.com/tiny-pilot/libnice-debian/releases/download/0.1.18-20221116/libnice10_0.1.18-20221116_armhf.deb" RUN wget "${LIBNICE_PKG_URL}" --output-document="libnice.deb" && \ dpkg --install libnice.deb From 55b05bdb475ea74ad53e5e44e77aadb0e223e078 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 09:57:51 -0500 Subject: [PATCH 08/11] Add more Janus dependencies --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index cdf0648..ed76e8a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,9 +38,12 @@ RUN apt-get install -y --no-install-recommends \ # 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 \ + nice \ gengetopt # Install libnice from a custom package because the version in apt-get is too From 40e81958256ca5f99ee3ee95ec64a3c8720ed094 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 10:01:51 -0500 Subject: [PATCH 09/11] Refactor debian file download --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ed76e8a..eb4ebe7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,8 +49,9 @@ RUN apt-get install -y --no-install-recommends \ # 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-20221116/libnice10_0.1.18-20221116_armhf.deb" -RUN wget "${LIBNICE_PKG_URL}" --output-document="libnice.deb" && \ - dpkg --install libnice.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" && \ From 083ecd8e4716e5f1766b396fa6f325768262eb35 Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 11:34:03 -0500 Subject: [PATCH 10/11] Update libnice package --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index eb4ebe7..fe4b221 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,7 +48,7 @@ RUN apt-get install -y --no-install-recommends \ # 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-20221116/libnice10_0.1.18-20221116_armhf.deb" +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 From f5ccf0f9bc82a0638f510f40a017148cb87436da Mon Sep 17 00:00:00 2001 From: Michael Lynch Date: Wed, 16 Nov 2022 11:39:47 -0500 Subject: [PATCH 11/11] Remove nice apt package --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fe4b221..2deed1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,7 +43,6 @@ RUN apt-get install -y --no-install-recommends \ libtool \ libjansson-dev \ libconfig-dev \ - nice \ gengetopt # Install libnice from a custom package because the version in apt-get is too