12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- FROM debian:stretch
- RUN dpkg --add-architecture armhf
- RUN apt-get update
- RUN apt-get install -y curl git build-essential crossbuild-essential-armhf
- RUN apt-get install -y libasound2-dev libasound2-dev:armhf
- RUN apt-get install -y pkg-config
- RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
- ENV PATH="/root/.cargo/bin/:${PATH}"
- RUN rustup target add arm-unknown-linux-gnueabihf
- RUN mkdir /.cargo && \
- echo '[target.arm-unknown-linux-gnueabihf]\nlinker = "arm-linux-gnueabihf-gcc"' >> /.cargo/config
- RUN mkdir /build
- ENV CARGO_TARGET_DIR /build
- ENV CARGO_HOME /build/cache
- ENV PKG_CONFIG_PATH /usr/lib/arm-linux-gnueabihf/pkgconfig/
- ENV PKG_CONFIG_ALLOW_CROSS 1
- ADD . /src
- WORKDIR /src
- RUN cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend"
- FROM resin/rpi-raspbian
- RUN apt-get update && \
- apt-get install libasound2 && \
- rm -rf /var/lib/apt/lists/*
- RUN mkdir /librespot
- WORKDIR /librespot
- COPY --from=0 /build/arm-unknown-linux-gnueabihf/release/librespot .
- RUN chmod +x librespot
- ENTRYPOINT ["./librespot"]
|