Files
Busch-Radio-Spotify/busch_radio_spotify/Dockerfile
retr0 5bcf9fca53 Fix: native-tls Feature für librespot-oauth aktiviert
--no-default-features deaktiviert auch native-tls, das librespot-oauth
als Pflicht-Feature benötigt (compile_error wenn keins der TLS-Features
aktiv ist). native-tls explizit wieder hinzufügen.

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

62 lines
1.9 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 \
git
# Librespot aus dem Git-Tag mit --locked kompilieren.
#
# Hintergrund: `cargo install librespot --version X.Y.Z` (ohne --locked) löst
# immer die NEUESTEN kompatiblen Abhängigkeiten auf. Das zieht vergen-gitcl
# >= 1.0 rein, das vergen-lib 9.x benötigt. librespot-core's build.rs erwartet
# jedoch vergen-lib 0.1.x → Versionkonflikt → Build-Fehler E0277.
#
# Mit `--git --tag --locked` verwendet cargo das originale Cargo.lock aus dem
# Release-Tag, das vergen-gitcl 0.x pinnt und damit kompatibel ist.
RUN cargo install \
--git https://github.com/librespot-org/librespot \
--tag v0.7.0 \
--locked \
--no-default-features \
--features "native-tls" \
--root /install \
librespot
# ============================================================
# 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"]