Sfoglia il codice sorgente

Upgrade debian to 'bullseye' version in Docker image

tyranron 4 anni fa
parent
commit
7a82602b61
5 ha cambiato i file con 86 aggiunte e 135 eliminazioni
  1. 61 65
      configure
  2. 10 0
      docker/coturn/CHANGELOG.md
  3. 1 1
      docker/coturn/Makefile
  4. 2 2
      docker/coturn/README.md
  5. 12 67
      docker/coturn/debian/Dockerfile

+ 61 - 65
configure

@@ -18,11 +18,11 @@ testlibraw() {
     ${CC} ${TMPCPROGC} -o ${TMPCPROGB} ${OSCFLAGS} ${OSLIBS} -${1} 2>>/dev/null
     ER=$?
     if ! [ ${ER} -eq 0 ] ; then
-		${ECHO_CMD} "Library option -${1} cannot be used"
-		return 0
+        ${ECHO_CMD} "Library option -${1} cannot be used"
+        return 0
     else
-		OSLIBS="${OSLIBS} -${1}"
-		return 1
+        OSLIBS="${OSLIBS} -${1}"
+        return 1
     fi
 }
 
@@ -187,11 +187,11 @@ cleanup
 #########################
 
 if [ -z "${ECHO_CMD}" ] ; then
-	ECHO_CMD=echo 
+	ECHO_CMD=echo
 fi
 
 if [ -z "${FIND_CMD}" ] ; then
-	FIND_CMD=find 
+	FIND_CMD=find
 fi
 
 if [ -z "${PORTNAME}" ] ; then
@@ -288,12 +288,12 @@ do
   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=* | -confdir=* | --confdir=*)
     CONFDIR=$ac_optarg ;;
-    
+
   -disable-rpath | --disable-rpath)
   	TURN_DISABLE_RPATH=1 ;;
-    
+
   esac
-      
+
 done
 
 if test -n "$ac_prev"; then
@@ -334,13 +334,13 @@ fi
 
 if [ -z "${LOCALSTATEDIR}" ] ; then
     if [ -z "${localstatedir}" ] ; then
-    
+
     	if [ "${PREFIX}" = "/usr" ] ; then
 			LOCALSTATEDIR=/var
 		else
 			LOCALSTATEDIR=${PREFIX}/var
 		fi
-		
+
     else
 		LOCALSTATEDIR=${localstatedir}
     fi
@@ -505,15 +505,6 @@ else
     fi
 fi
 
-#############################
-# Adjustments for Debian
-#############################
-
-if [ -f "/etc/debian_version" ] ; then
-    # https://github.com/coturn/coturn/pull/754#issuecomment-824693226
-    OSLIBS="${OSLIBS} -latomic"
-fi
-
 #############################
 # Adjustments for Solaris
 #############################
@@ -706,7 +697,7 @@ fi
 
 ###########################
 # Test some general-purpose
-# libraries 
+# libraries
 ###########################
 
 testlib socket
@@ -738,15 +729,15 @@ if [ ${ER} -ne 0 ] ; then
     exit 1
 fi
 
-if [ -z ${TURN_NO_THREAD_BARRIERS} ] ; then 
+if [ -z ${TURN_NO_THREAD_BARRIERS} ] ; then
 	pthread_testbarriers
-else 
+else
 	TURN_NO_THREAD_BARRIERS="-DTURN_NO_THREAD_BARRIERS"
 fi
 
-if [ -z ${TURN_IP_RECVERR} ] ; then 
+if [ -z ${TURN_IP_RECVERR} ] ; then
 	${ECHO_CMD} "Ignore IP_RECVERR"
-else 
+else
 	${ECHO_CMD} "Use IP_RECVERR"
 	TURN_IP_RECVERR="-DTURN_IP_RECVERR"
 	OSCFLAGS="${OSCFLAGS} ${TURN_IP_RECVERR}"
@@ -780,7 +771,7 @@ else
 	    ER=$?
         if ! [ ${ER} -eq 0 ] ; then
             ${ECHO_CMD} "OpenSSL Crypto lib found."
-        else        
+        else
             ${ECHO_CMD} "ERROR: OpenSSL Crypto development libraries are not installed properly in required location."
             ${ECHO_CMD} "Abort."
             cleanup
@@ -807,7 +798,7 @@ fi
 # Can we use GCM cipher ?
 ###########################
 
-if [ -z ${TURN_NO_GCM} ] ; then 
+if [ -z ${TURN_NO_GCM} ] ; then
 
 gcm_testlib
 ER=$?
@@ -853,45 +844,50 @@ fi
 
 if [ -z "${TURN_NO_PROMETHEUS}" ] ; then
 
-	testlib prom
-	ER=$?
-	if ! [ ${ER} -eq 0 ] ; then
-		${ECHO_CMD} "Prometheus lib found."
-		testlib promhttp
-		ER=$?
-		if ! [ ${ER} -eq 0 ] ; then
-			${ECHO_CMD} "Prometheus http lib found."
-			testlib microhttpd
-			ER=$?
-			if ! [ ${ER} -eq 0 ] ; then
-				${ECHO_CMD} "Microhttpd lib found."
-			else
-				${ECHO_CMD}
-				${ECHO_CMD} "Warning: microhttpd development libraries are not installed properly in required location."
-				${ECHO_CMD} "Prometheus support will be disabled."
-				${ECHO_CMD} "See the INSTALL file."
-				${ECHO_CMD}
-				OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
-			fi
-		else
-			${ECHO_CMD}
-			${ECHO_CMD} "Warning: Libpromhttp development libraries are not installed properly in required location."
-			${ECHO_CMD} "Prometheus support will be disabled."
-			${ECHO_CMD} "See the INSTALL file."
-			${ECHO_CMD}
-			OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
-		fi
-	else
-		${ECHO_CMD}
-		${ECHO_CMD} "Warning: Libprom development libraries are not installed properly in required location."
-		${ECHO_CMD} "Prometheus support will be disabled."
-		${ECHO_CMD} "See the INSTALL file."
-		${ECHO_CMD}
-		OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
-	fi
+    testlib prom
+    ER=$?
+    if ! [ ${ER} -eq 0 ] ; then
+        ${ECHO_CMD} "Prometheus lib found."
+        testlib promhttp
+        ER=$?
+        if ! [ ${ER} -eq 0 ] ; then
+            ${ECHO_CMD} "Prometheus http lib found."
+            testlib microhttpd
+            ER=$?
+            if ! [ ${ER} -eq 0 ] ; then
+                ${ECHO_CMD} "Microhttpd lib found."
+                # Adjustments for Debian
+                # See: https://github.com/coturn/coturn/pull/754#issuecomment-824693226
+                if [ -f "/etc/debian_version" ] ; then
+                    OSLIBS="${OSLIBS} -latomic"
+                fi
+            else
+                ${ECHO_CMD}
+                ${ECHO_CMD} "Warning: microhttpd development libraries are not installed properly in required location."
+                ${ECHO_CMD} "Prometheus support will be disabled."
+                ${ECHO_CMD} "See the INSTALL file."
+                ${ECHO_CMD}
+                OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
+            fi
+        else
+            ${ECHO_CMD}
+            ${ECHO_CMD} "Warning: Libpromhttp development libraries are not installed properly in required location."
+            ${ECHO_CMD} "Prometheus support will be disabled."
+            ${ECHO_CMD} "See the INSTALL file."
+            ${ECHO_CMD}
+            OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
+        fi
+    else
+        ${ECHO_CMD}
+        ${ECHO_CMD} "Warning: Libprom development libraries are not installed properly in required location."
+        ${ECHO_CMD} "Prometheus support will be disabled."
+        ${ECHO_CMD} "See the INSTALL file."
+        ${ECHO_CMD}
+        OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
+    fi
 
 else
-	OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
+    OSCFLAGS="${OSCFLAGS} -DTURN_NO_PROMETHEUS"
 fi
 
 ###########################
@@ -997,7 +993,7 @@ if [ -z "${LDCONFIG}" ] ; then
 	ISBSD=`uname | grep -i bsd`
 	if [ -z "${ISBSD}" ] ; then
 		ISLINUX=`uname | grep -i linux`
-		if [ -z "${ISLINUX}" ] ; then 
+		if [ -z "${ISLINUX}" ] ; then
 			SYSTEM=`uname`
 			if [ "${SYSTEM}" = "SunOS" ] ; then
 				LDCONFIG="crle -u -l"

+ 10 - 0
docker/coturn/CHANGELOG.md

@@ -4,6 +4,16 @@ Coturn TURN server Docker image changelog
 
 
 
+## [4.5.2-r5] · 2021-08-29
+[4.5.2-r5]: /../../tree/docker/4.5.2-r5
+
+### Upgraded
+
+- [Debian Linux] "buster": <https://www.debian.org/releases/bullseye/releasenotes>
+
+
+
+
 ## [4.5.2-r4] · 2021-08-28
 [4.5.2-r4]: /../../tree/docker/4.5.2-r4
 

+ 1 - 1
docker/coturn/Makefile

@@ -21,7 +21,7 @@ COTURN_VER ?= 4.5.2
 COTURN_MIN_VER = $(strip $(shell echo $(COTURN_VER) | cut -d '.' -f1,2))
 COTURN_MAJ_VER = $(strip $(shell echo $(COTURN_VER) | cut -d '.' -f1))
 
-BUILD_REV ?= 4
+BUILD_REV ?= 5
 
 NAMESPACES := coturn \
               ghcr.io/coturn \

+ 2 - 2
docker/coturn/README.md

@@ -15,8 +15,8 @@ Coturn TURN server Docker image
 
 ## Supported tags and respective `Dockerfile` links
 
-- [`4.5.2-r4`, `4.5.2-r3-debian`, `4.5.2`, `4.5.2-debian`, `4.5`, `4.5-debian`, `4`, `4-debian`, `debian`, `latest`][d1]
-- [`4.5.2-r4-alpine`, `4.5.2-alpine`, `4.5-alpine`, `4-alpine`, `alpine`][d2]
+- [`4.5.2-r5`, `4.5.2-r5-debian`, `4.5.2`, `4.5.2-debian`, `4.5`, `4.5-debian`, `4`, `4-debian`, `debian`, `latest`][d1]
+- [`4.5.2-r5-alpine`, `4.5.2-alpine`, `4.5-alpine`, `4-alpine`, `alpine`][d2]
 
 
 

+ 12 - 67
docker/coturn/debian/Dockerfile

@@ -2,7 +2,7 @@
 # Dockerfile of coturn/coturn:debian Docker image.
 #
 
-ARG debian_ver=buster
+ARG debian_ver=bullseye
 
 
 
@@ -11,14 +11,13 @@ ARG debian_ver=buster
 # Stage 'dist-libprom' creates prometheus-client-c distribution.
 #
 
-# We compile prometheus-client-c from sources, because Alpine doesn't provide
+# We compile prometheus-client-c from sources, because Debian doesn't provide
 # it as its package yet.
 #
 # TODO: Re-check this to be present in packages on next Debian major version update.
 
 # https://hub.docker.com/_/debian
-# We use 'bullseye' here due to too old cmake on 'buster'.
-FROM debian:bullseye-slim AS dist-libprom
+FROM debian:${debian_ver}-slim AS dist-libprom
 
 # Install tools for building.
 RUN apt-get update \
@@ -76,60 +75,6 @@ RUN LIBS_DIR=/out/$(dirname $(find /usr/ -name libc.so)) \
 
 
 
-#
-# Stage 'dist-mongoc' creates mongo-c-driver distribution.
-#
-
-# We compile mongo-c-driver from sources, because buster Debian `libmongoc` packages
-# cointain too old driver version, being not compatible with latest MongoDB versions well.
-#
-# TODO: Reconsider this on next stable Debian version update.
-
-# https://hub.docker.com/_/debian
-FROM debian:${debian_ver}-slim AS dist-mongoc
-
-# Install tools for building.
-RUN apt-get update \
- && apt-get install -y --no-install-recommends --no-install-suggests \
-            ca-certificates cmake g++ gcc git make python \
- && update-ca-certificates
-
-# Install mongo-c-driver build dependencies.
-RUN apt-get install -y --no-install-recommends --no-install-suggests \
-            libssl-dev
-
-# Prepare mongo-c-driver sources for building.
-ARG mongoc_ver=1.17.5
-RUN mkdir -p /tmp/mongoc/src/ && cd /tmp/mongoc/src/ \
- && git init \
- && git remote add origin https://github.com/mongodb/mongo-c-driver \
- && git fetch --depth=1 origin "${mongoc_ver}" \
- && git checkout FETCH_HEAD \
- && python build/calc_release_version.py > VERSION_CURRENT
-
-# Build mongo-c-driver from sources.
-RUN mkdir -p /tmp/mongoc/build/ && cd /tmp/mongoc/build/ \
- && cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF \
-          -DCMAKE_BUILD_TYPE=Release \
-          /tmp/mongoc/src
-RUN rm -rf /build && mkdir -p /build/ \
- && cd /tmp/mongoc/build/ \
- && DESTDIR=/build cmake --build . --target install
-
-# Install mongo-c-driver.
-RUN LIBS_DIR=/out/$(dirname $(find /usr/ -name libc.so)) \
- && mkdir -p $LIBS_DIR/ \
- && cp -rf /build/usr/local/lib/* $LIBS_DIR/ \
- && mkdir -p /out/usr/include/ \
- && cp -rf /build/usr/local/include/libbson-1.0/* /out/usr/include/ \
- && cp -rf /build/usr/local/include/libmongoc-1.0/* /out/usr/include/ \
- # Preserve license file.
- && mkdir -p /out/usr/share/licenses/mongo-c-driver/ \
- && cp /build/usr/local/share/mongo-c-driver/COPYING /out/usr/share/licenses/mongo-c-driver/
-
-
-
-
 #
 # Stage 'dist-coturn' creates Coturn distribution.
 #
@@ -149,10 +94,9 @@ RUN apt-get install -y --no-install-recommends --no-install-suggests \
             libssl-dev \
             libpq-dev libmariadb-dev libsqlite3-dev \
             libhiredis-dev \
+            libmongoc-dev \
             libmicrohttpd-dev
 
-# Install mongo-c-driver distribution.
-COPY --from=dist-mongoc /out/ /
 # Install prometheus-client-c distribution.
 COPY --from=dist-libprom /out/ /
 
@@ -181,11 +125,13 @@ RUN if [ "${coturn_git_ref}" != 'HEAD' ]; then true \
  && git fetch --depth=1 origin "${coturn_git_ref}" \
  && git checkout FETCH_HEAD \
  && true; fi
+# TODO: Remove `OSLIBS` line with next Coturn release having it in `configure`.
+RUN if [ "${coturn_git_ref}" = '4.5.2' ]; then true \
+ && sed -i -e '850i\OSLIBS="$\{OSLIBS\} -latomic"' ./configure \
+ && true; fi
 
 # Build Coturn from sources.
-# TODO: Remove `LDFLAGS` with next Coturn release containing `-latomic` flag in `configure`.
-RUN LDFLAGS='-latomic' \
-    ./configure --prefix=/usr \
+RUN ./configure --prefix=/usr \
                 --turndbdir=/var/lib/coturn \
                 --disable-rpath \
                 --sysconfdir=/etc/coturn \
@@ -215,8 +161,6 @@ RUN ln -s /usr/local/bin/detect-external-ip.sh \
           /out/usr/local/bin/detect-external-ip
 RUN chown -R nobody:nogroup /out/var/lib/coturn/
 
-# Re-export mongo-c-driver distribution.
-COPY --from=dist-mongoc /out/ /out/
 # Re-export prometheus-client-c distribution.
 COPY --from=dist-libprom /out/ /out/
 
@@ -241,11 +185,12 @@ RUN apt-get update \
  # Install Coturn dependencies.
  && apt-get install -y --no-install-recommends --no-install-suggests \
             libatomic1 \
-            libevent-2.1-6 libevent-core-2.1-6 libevent-extra-2.1-6 \
-            libevent-openssl-2.1-6 libevent-pthreads-2.1-6 \
+            libevent-2.1-7 libevent-core-2.1-7 libevent-extra-2.1-7 \
+            libevent-openssl-2.1-7 libevent-pthreads-2.1-7 \
             libssl1.1 \
             libpq5 libmariadb3 libsqlite3-0 \
             libhiredis0.14 \
+            libmongoc-1.0-0 \
             libmicrohttpd12 \
  # Install `dig` tool for `detect-external-ip.sh`.
  && apt-get install -y --no-install-recommends --no-install-suggests \