forked from tmigone/librespot-docker
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.template
32 lines (21 loc) · 918 Bytes
/
Dockerfile.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
ARG BALENA_ARCH=%%BALENA_ARCH%%
# Build process from: https://git.alpinelinux.org/aports/tree/testing/librespot/APKBUILD
FROM balenalib/$BALENA_ARCH-alpine:3.14 AS librespot-builder
WORKDIR /app
ARG LIBRESPOT_VERSION=0.3.1
RUN install_packages alsa-lib-dev cargo curl
RUN curl -sL "https://github.com/librespot-org/librespot/archive/refs/tags/v${LIBRESPOT_VERSION}.tar.gz" --output librespot.tar.gz && \
mkdir /app/librespot-src && \
tar -zxvf librespot.tar.gz --directory /app/librespot-src --strip-components=1
WORKDIR /app/librespot-src
ENV CARGO_HOME=/app/cargo
ENV RUSTFLAGS="-C target-feature=-crt-static"
RUN cargo build \
--release \
--features alsa-backend \
--verbose
FROM balenalib/$BALENA_ARCH-alpine:3.14-run
WORKDIR /app
RUN install_packages libgcc alsa-lib-dev
COPY --from=librespot-builder /app/librespot-src/target/release/librespot /usr/bin/librespot
CMD [ "/usr/bin/librespot" ]