Build DJ1JAY’s fork with an optional Satellite/Trunk stub, allow -c/--config, open capture and playback as separate devices, and add a lab start helper. Co-authored-by: Cursor <cursoragent@cursor.com>
73 lines
2.5 KiB
Docker
73 lines
2.5 KiB
Docker
# Build jayReflector (DJ1JAY / FM-Funknetz) for the Funknetz local lab.
|
|
# Binary name remains svxreflector; Trunk/Satellite are opt-in via config.
|
|
# Upstream pattern: dj1jay/jayReflector Dockerfile (clone + cmake, not stock sm0svx).
|
|
|
|
# =========================================================
|
|
# STAGE 1 — BUILD
|
|
# =========================================================
|
|
FROM debian:bookworm AS builder
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get -y install --no-install-recommends \
|
|
git ca-certificates \
|
|
build-essential cmake \
|
|
libsigc++-2.0-dev libssl-dev libjsoncpp-dev libpopt-dev \
|
|
libopus-dev libgsm1-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
ARG GIT_URL=https://github.com/dj1jay/jayReflector.git
|
|
ARG GIT_BRANCH=main
|
|
ARG GIT_REF=
|
|
ARG NUM_CORES=4
|
|
|
|
WORKDIR /build
|
|
RUN set -eux; \
|
|
if [ -n "${GIT_REF}" ]; then \
|
|
git clone --recursive "${GIT_URL}" jayReflector; \
|
|
cd jayReflector && git checkout "${GIT_REF}"; \
|
|
else \
|
|
git clone --recursive --depth 1 --branch "${GIT_BRANCH}" "${GIT_URL}" jayReflector; \
|
|
fi
|
|
|
|
WORKDIR /build/jayReflector
|
|
RUN set -eux; \
|
|
cmake -S src -B build \
|
|
-DLOCAL_STATE_DIR=/var \
|
|
-DUSE_QT=OFF \
|
|
-DUSE_ALSA=OFF \
|
|
-DCMAKE_BUILD_TYPE=Release; \
|
|
cmake --build build --target svxreflector -j"${NUM_CORES}"
|
|
|
|
# =========================================================
|
|
# STAGE 2 — RUNTIME
|
|
# =========================================================
|
|
FROM debian:bookworm-slim
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
RUN apt-get update && apt-get -y install --no-install-recommends \
|
|
ca-certificates openssl \
|
|
libsigc++-2.0-0v5 libssl3 libjsoncpp25 libpopt0 \
|
|
libopus0 libgsm1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /build/jayReflector/build/bin/svxreflector /usr/bin/svxreflector
|
|
COPY --from=builder /build/jayReflector/build/lib/lib*.so* /usr/lib/
|
|
|
|
RUN mkdir -p /etc/svxlink /etc/svxlink/pki /var/log/svxlink /var/lib/svxlink && \
|
|
ldconfig && \
|
|
useradd -r -u 1000 -m -d /home/svx svx || true
|
|
|
|
ENV SVXREFLECTOR_CONF=/etc/svxlink/svxreflector.conf \
|
|
SVXREFLECTOR_LINK_CONF=/etc/svxlink/svxreflector.link.conf \
|
|
ENABLE_FM_LINK=0
|
|
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
# 5300: local Funknetz / SvxLink clients (TCP+UDP)
|
|
# Satellite mode dials out to parent :5303 — no inbound peer port required.
|
|
# Trunk mode would need 5302/tcp inbound; not published by default in compose.
|
|
EXPOSE 5300/tcp 5300/udp
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|