spotifyd-docker/Dockerfile

32 lines
885 B
Docker

FROM --platform=$BUILDPLATFORM golang:1-bullseye as build
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 ca-certificates wget
WORKDIR /
RUN wget ${URL} -O - | tar -xz && chmod +x spotifyd
COPY main.go /main.go
RUN GOARCH=arm go build -o /runner /main.go
FROM --platform=$TARGETPLATFORM debian:bullseye-slim
COPY --from=build /spotifyd /app/spotifyd
COPY --from=build /runner /app/runner
COPY start.sh /app/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/runner" ]