Updated to work on a raspberry pi

This commit is contained in:
2023-08-26 23:40:56 +02:00
parent 2d918a19bc
commit 4b6be075c1
5 changed files with 40 additions and 25 deletions

View File

@@ -1,26 +1,25 @@
FROM rust as build
FROM --platform=$BUILDPLATFORM debian:bullseye-slim as build
WORKDIR /build
RUN apt-get -yqq update && \
apt-get install --no-install-recommends -yqq libasound2-dev && \
git clone --branch=master https://github.com/Spotifyd/spotifyd.git .
RUN cargo build --release --features alsa_backend
FROM debian:bullseye-slim
ENV SPOTIFYD_VERSION=v0.3.5
ENV URL=https://github.com/Spotifyd/spotifyd/releases/download/${SPOTIFYD_VERSION}/spotifyd-linux-armhf-full.tar.gz
RUN apt-get update && \
apt-get install -yqq --no-install-recommends libasound2 alsa-utils && \
rm -rf /var/lib/apt/lists/* && \
groupadd -r spotify && \
useradd --no-log-init -r -g spotify -G audio spotify
apt-get install -yqq --no-install-recommends ca-certificates wget
USER spotify
RUN wget ${URL} -O - | tar -xz && chmod +x /spotifyd
COPY --from=build /build/target/release/spotifyd /spotifyd
COPY start.sh /start.sh
FROM --platform=$TARGETPLATFORM debian:bullseye-slim
WORKDIR /
COPY --from=build /spotifyd /app/spotifyd
COPY start.sh /app/start.sh
ENTRYPOINT [ "/start.sh" ]
RUN apt-get update && \
apt-get install -yqq --no-install-recommends ca-certificates libdbus-1-3 libasound2 && \
useradd -r -s /bin/false spotifyd && \
usermod -a -G audio spotifyd && \
chown -R spotifyd:spotifyd /app
USER spotifyd
WORKDIR /app
ENTRYPOINT [ "/app/start.sh" ]