spotifyd-docker/Dockerfile

32 lines
885 B
Docker
Raw Permalink Normal View History

FROM --platform=$BUILDPLATFORM golang:1-bullseye as build
2022-02-05 23:52:44 +00:00
2023-08-26 21:40:56 +00:00
ENV SPOTIFYD_VERSION=v0.3.5
ENV URL=https://github.com/Spotifyd/spotifyd/releases/download/${SPOTIFYD_VERSION}/spotifyd-linux-armhf-full.tar.gz
2022-02-05 23:52:44 +00:00
2023-08-26 21:40:56 +00:00
RUN apt-get update && \
apt-get install -yqq --no-install-recommends ca-certificates wget
2022-02-05 23:52:44 +00:00
WORKDIR /
RUN wget ${URL} -O - | tar -xz && chmod +x spotifyd
COPY main.go /main.go
RUN GOARCH=arm go build -o /runner /main.go
2022-02-05 23:52:44 +00:00
2023-08-26 21:40:56 +00:00
FROM --platform=$TARGETPLATFORM debian:bullseye-slim
2022-02-05 23:52:44 +00:00
2023-08-26 21:40:56 +00:00
COPY --from=build /spotifyd /app/spotifyd
COPY --from=build /runner /app/runner
2023-08-26 21:40:56 +00:00
COPY start.sh /app/start.sh
2022-02-05 23:52:44 +00:00
2023-08-26 21:40:56 +00:00
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
2022-02-05 23:52:44 +00:00
2023-08-26 21:40:56 +00:00
USER spotifyd
WORKDIR /app
2022-02-05 23:52:44 +00:00
ENTRYPOINT [ "/app/runner" ]