2016-04-12 10:06:54 +02:00
|
|
|
FROM ubuntu:14.04
|
|
|
|
WORKDIR /build
|
|
|
|
# install tools and dependencies
|
|
|
|
RUN apt-get -y update && \
|
2016-06-29 14:46:29 +02:00
|
|
|
apt-get install -y --force-yes --no-install-recommends \
|
|
|
|
curl git make g++ gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
|
|
|
|
libc6-dev-armhf-cross wget file ca-certificates \
|
|
|
|
binutils-arm-linux-gnueabihf \
|
|
|
|
&& \
|
2016-04-12 10:06:54 +02:00
|
|
|
apt-get clean
|
|
|
|
|
2016-06-29 14:46:29 +02:00
|
|
|
# install rustup
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
|
|
|
|
|
|
# rustup directory
|
|
|
|
ENV PATH /root/.cargo/bin:$PATH
|
|
|
|
|
2016-04-12 10:06:54 +02:00
|
|
|
ENV RUST_TARGETS="arm-unknown-linux-gnueabihf"
|
|
|
|
|
|
|
|
# multirust add arm--linux-gnuabhf toolchain
|
2016-06-29 14:46:29 +02:00
|
|
|
RUN rustup target add armv7-unknown-linux-gnueabihf
|
2016-04-12 10:06:54 +02:00
|
|
|
|
|
|
|
# show backtraces
|
|
|
|
ENV RUST_BACKTRACE 1
|
2016-06-29 14:46:29 +02:00
|
|
|
|
2016-04-12 10:06:54 +02:00
|
|
|
# set compilers
|
2016-06-29 14:46:29 +02:00
|
|
|
ENV CXX arm-linux-gnueabihf-g++
|
|
|
|
ENV CC arm-linux-gnueabihf-gcc
|
|
|
|
|
|
|
|
# show tools
|
|
|
|
RUN rustc -vV && \
|
|
|
|
cargo -V && \
|
|
|
|
gcc -v &&\
|
|
|
|
g++ -v
|
|
|
|
|
2016-04-12 10:06:54 +02:00
|
|
|
# build parity
|
|
|
|
RUN git clone https://github.com/ethcore/parity && \
|
2016-06-29 14:46:29 +02:00
|
|
|
cd parity && \
|
|
|
|
mkdir -p .cargo && \
|
|
|
|
echo '[target.armv7-unknown-linux-gnueabihf]\n\
|
|
|
|
linker = "arm-linux-gnueabihf-gcc"\n'\
|
|
|
|
>>.cargo/config && \
|
|
|
|
cat .cargo/config && \
|
|
|
|
cargo build --target armv7-unknown-linux-gnueabihf --release --verbose && \
|
|
|
|
ls /build/parity/target/armv7-unknown-linux-gnueabihf/release/parity && \
|
|
|
|
/usr/bin/arm-linux-gnueabihf-strip /build/parity/target/armv7-unknown-linux-gnueabihf/release/parity
|
|
|
|
RUN file /build/parity/target/armv7-unknown-linux-gnueabihf/release/parity
|