Files
nr-flow-validator/infra/librespot/Dockerfile
T
david b2e44369a9 librespot: fix CMD args (--enable-audio-cache is invalid; --initial-volume)
v0.8.0 librespot uses --disable-audio-cache (audio cache is on by default).
Renamed and added --initial-volume 100 for full startup volume.
2026-07-01 07:24:50 -07:00

44 lines
1.3 KiB
Docker

# Librespot (Spotify Connect) for ARM64
# Multi-stage Docker build. Run on ARM64 host (RPi 3B+ etc).
# Audio output: PulseAudio (connects to audio-bridge via TCP localhost:4713).
FROM rust:1.85.1-bookworm AS builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpulse-dev \
libasound2-dev \
&& rm -rf /var/lib/apt/lists/*
ARG LIBRESPOT_VERSION=v0.8.0
RUN git clone --depth 1 --branch ${LIBRESPOT_VERSION} \
https://github.com/librespot-org/librespot.git /src
WORKDIR /src
# Limit parallelism to 2 (RPi 3B+ has 4 cores but only 1GB RAM).
# Lower = less memory pressure, slower build. Higher = OOM risk.
RUN cargo build --release --jobs 2 \
--no-default-features \
--features="pulseaudio-backend,native-tls"
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
libpulse0 \
libasound2 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /src/target/release/librespot /usr/local/bin/librespot
VOLUME ["/var/cache/librespot"]
ENV PULSE_SERVER=tcp:127.0.0.1:4713
CMD ["librespot", \
"--name", "Klubhaus", \
"--backend", "pulseaudio", \
"--bitrate", "320", \
"--initial-volume", "100", \
"--cache", "/var/cache/librespot"]