Skip to content

Instantly share code, notes, and snippets.

@herrernst
Last active December 20, 2016 22:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save herrernst/1034b85986656a15943b13156f337d63 to your computer and use it in GitHub Desktop.
Save herrernst/1034b85986656a15943b13156f337d63 to your computer and use it in GitHub Desktop.
Dockerfile to build librespot on Ubuntu Trusty
FROM ubuntu:trusty
RUN dpkg --add-architecture armhf
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/ trusty main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ trusty-security main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ trusty-updates main" >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get install -y gcc-arm-linux-gnueabihf libasound2:armhf libasound2-dev:armhf
RUN apt-get install -y gcc g++ git curl pkg-config libprotoc-dev file
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
RUN echo '[target.armv7-unknown-linux-gnueabihf]' > ~/.cargo/config
RUN echo 'linker = "arm-linux-gnueabihf-gcc"' >> ~/.cargo/config
CMD cd $HOME/librespot && git checkout add-simple-alsa-backend && git pull && cargo build --release --target armv7-unknown-linux-gnueabihf
@herrernst
Copy link
Author

herrernst commented Dec 20, 2016

TODO how get result out of container
Not in the intention of the inventor: https://github.com/jpetazzo/nsenter/issues/27#issuecomment-229570122

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