forked from tmigone/librespot-docker
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile.pulseaudio.template
39 lines (26 loc) · 1.19 KB
/
Dockerfile.pulseaudio.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
33
34
35
36
37
38
39
ARG BALENA_ARCH=%%BALENA_ARCH%%
# Build process from: https://git.alpinelinux.org/aports/tree/testing/librespot/APKBUILD
FROM balenalib/$BALENA_ARCH-alpine:edge AS librespot-builder
WORKDIR /app
ARG LIBRESPOT_VERSION=0.4.2
RUN install_packages alsa-lib-dev pulseaudio-dev cargo curl build-base cmake clang-dev llvm-dev
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"
ENV AWS_LC_SYS_EXTERNAL_BINDGEN=1
ENV BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include"
ENV LIBCLANG_PATH="/usr/lib"
RUN cargo install --force --locked bindgen-cli && \
ln -s /app/cargo/bin/bindgen /usr/local/bin/bindgen
RUN cargo build \
--release \
--features alsa-backend,pulseaudio-backend \
--verbose
FROM balenalib/$BALENA_ARCH-alpine:3.14-run
WORKDIR /app
RUN install_packages libgcc alsa-lib-dev pulseaudio-dev
COPY --from=librespot-builder /app/librespot-src/target/release/librespot /usr/bin/librespot
CMD [ "/usr/bin/librespot" ]