Skip to content

Instantly share code, notes, and snippets.

@herrernst
Created December 20, 2016 22:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herrernst/17d17255f5f30a6f20f0881eda816884 to your computer and use it in GitHub Desktop.
Save herrernst/17d17255f5f30a6f20f0881eda816884 to your computer and use it in GitHub Desktop.
Dockerfile to build librespot on Ubuntu Precise
FROM ubuntu:precise
RUN echo -n "foreign-architecture armhf" > /etc/dpkg/dpkg.cfg.d/multiarch
RUN sed -i 's/deb /deb [arch=amd64,i386] /g' /etc/apt/sources.list
RUN sed -i 's/deb-src /#deb-src /g' /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise-security main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise-updates main" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y gcc-arm-linux-gnueabihf libasound2:armhf libasound2-dev:armhf portaudio19-dev:armhf
RUN apt-get install -y gcc g++ git curl pkg-config libprotoc-dev file make
RUN curl -o /usr/local/bin/rustup.sh https://static.rust-lang.org/rustup.sh
RUN chmod +x /usr/local/bin/rustup.sh
RUN rustup.sh --disable-sudo
RUN rustup.sh --disable-sudo --add-target=armv7-unknown-linux-gnueabihf
RUN cd && git clone https://github.com/plietar/librespot && cd librespot && cargo fetch && git reset --hard
RUN echo '[target.armv7-unknown-linux-gnueabihf]' > ~/.cargo/config
RUN echo 'linker = "arm-linux-gnueabihf-gcc"' >> ~/.cargo/config
CMD cd $HOME/librespot && git pull && PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig PKG_CONFIG_ALLOW_CROSS=1 cargo build --release --target armv7-unknown-linux-gnueabihf
@herrernst
Copy link
Author

TODO how get result out of container

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment