Files
Busch-Radio-Spotify/busch_radio_spotify/Dockerfile
retr0 36dbf0c588 Fix: librespot auf v0.7.0 gepinnt
v0.8.0 hat einen Build-Fehler (E0277): vergen und vergen-lib liegen in
inkompatiblen Versionen im Dependency-Graph vor, was den Build-Script
von librespot-core bricht. v0.7.0 ist stabil und frei von diesem Bug.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 13:05:24 +02:00

54 lines
1.5 KiB
Docker

ARG BUILD_FROM
# ============================================================
# Build stage: Librespot aus Rust-Quellcode kompilieren
# ============================================================
FROM rust:alpine AS librespot-builder
RUN apk add --no-cache \
musl-dev \
pkgconfig \
openssl-dev \
openssl-libs-static
# Librespot ohne Hardware-Audio-Backends kompilieren.
# --no-default-features entfernt ALSA/PulseAudio; der Pipe-Backend
# ist immer verfügbar und reicht für diesen Anwendungsfall.
#
# v0.8.0 hat einen bekannten Build-Bug (vergen/vergen-lib Versionskonflikt),
# daher wird die stabile Version 0.7.0 verwendet.
RUN cargo install librespot \
--version "0.7.0" \
--no-default-features \
--root /install
# ============================================================
# Runtime stage: HA-Basis-Image + ffmpeg + icecast
# ============================================================
FROM ${BUILD_FROM}
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Abhängigkeiten installieren
# icecast liegt in Alpine's Community-Repository
RUN apk add --no-cache \
bash \
jq \
curl \
python3 \
ffmpeg \
&& apk add --no-cache \
--repository=https://dl-cdn.alpinelinux.org/alpine/edge/community \
icecast \
|| apk add --no-cache icecast
# Librespot-Binary aus dem Build-Stage übernehmen
COPY --from=librespot-builder /install/bin/librespot /usr/local/bin/librespot
RUN chmod +x /usr/local/bin/librespot
# Add-on Dateien kopieren
COPY run.sh /run.sh
RUN chmod a+x /run.sh
CMD ["/run.sh"]