Skip to content

Commit

Permalink
Upgrade debian to 'bullseye' version in Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Aug 28, 2021
1 parent f383e5e commit 883c06f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 64 deletions.
4 changes: 4 additions & 0 deletions docker/coturn/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Coturn TURN server Docker image changelog
## [4.5.2-r4] · 2021-08-28
[4.5.2-r4]: /../../tree/docker/4.5.2-r4

### Upgraded

- [Debian Linux] "buster": <https://www.debian.org/releases/bullseye/releasenotes>

### Security updated

- [Alpine Linux] 3.14.2: <https://github.com/docker-library/official-images/commit/b54effe0cc65795f29752ecc197328a04326a6f2>
Expand Down
72 changes: 8 additions & 64 deletions docker/coturn/debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Dockerfile of coturn/coturn:debian Docker image.
#

ARG debian_ver=buster
ARG debian_ver=bullseye



Expand All @@ -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 \
Expand Down Expand Up @@ -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.
#
Expand All @@ -145,14 +90,14 @@ RUN apt-get update \

# Install Coturn build dependencies.
RUN apt-get install -y --no-install-recommends --no-install-suggests \
libatomic-ops-dev \
libevent-dev \
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/ /

Expand Down Expand Up @@ -215,8 +160,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/

Expand All @@ -241,11 +184,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 \
Expand Down

0 comments on commit 883c06f

Please sign in to comment.