coturn: Move to source-built image, version 4.6.2

This also improves base image caching by re-using as many initial steps
as possible.
This commit is contained in:
Alex Palaistras 2023-12-22 17:54:13 +00:00
parent f9351e64eb
commit 8f3773a780
2 changed files with 17 additions and 5 deletions

View File

@ -1,8 +1,20 @@
FROM docker.io/debian:bookworm-slim@sha256:f80c45482c8d147da87613cb6878a7238b8642bcc24fc11bad78c7bec726f340
ARG VERSION=4.6.1 # renovate: datasource=repology depName=debian_12/dovecot versioning=loose
FROM docker.io/debian:bookworm-slim@sha256:f80c45482c8d147da87613cb6878a7238b8642bcc24fc11bad78c7bec726f340 AS builder
RUN apt-get update -y && apt-get install -y --no-install-recommends \
ca-certificates build-essential pkg-config git libevent-dev libssl-dev
ARG VERSION=4.6.2 # renovate: datasource=github-releases depName=coturn/coturn
RUN git clone --branch ${VERSION} --depth=1 https://github.com/coturn/coturn.git /src && \
mkdir /build && cd /src && ./configure --prefix=/usr --turndbdir=/var/lib/coturn && \
make && make install DESTDIR=/build
FROM docker.io/debian:bookworm-slim@sha256:f80c45482c8d147da87613cb6878a7238b8642bcc24fc11bad78c7bec726f340
RUN apt-get update -y && apt-get upgrade -y && \
apt-get install -y --no-install-recommends coturn=${VERSION}* gettext ca-certificates
apt-get install -y --no-install-recommends ca-certificates gettext gosu
RUN apt-get install -y --no-install-recommends \
libevent-2.1 libssl3
COPY --from=builder /build /
COPY container/config /etc/coturn
COPY container/run-coturn /run-coturn

View File

@ -2,9 +2,9 @@
set -eu
# Prepare configuration files for environment variable substitution.
ENV_NAMES="$(env | awk -F= '{printf "$%s ", $1}')"
ENV_NAMES="$(env | awk -F '=' '{printf "$%s ", $1}')"
for file in /etc/coturn/*.template; do
envsubst "$ENV_NAMES" < "$file" > "$(echo "$file" | awk -F '.template$' '{print $1}')"
envsubst "$ENV_NAMES" < "$file" > "${file%.template}"
done
/usr/bin/turnserver -c /etc/coturn/turnserver.conf