2016-04-12 10:06:54 +02:00
|
|
|
FROM ubuntu:14.04
|
|
|
|
WORKDIR /build
|
2017-05-23 12:25:41 +02:00
|
|
|
|
2016-04-12 10:06:54 +02:00
|
|
|
# install tools and dependencies
|
|
|
|
RUN apt-get -y update && \
|
2016-06-24 21:58:06 +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 \
|
2020-07-30 02:45:43 +02:00
|
|
|
binutils-arm-linux-gnueabihf cmake3 \
|
2016-06-24 21:58:06 +02:00
|
|
|
&& \
|
2020-09-22 14:53:52 +02:00
|
|
|
apt-get clean
|
2016-04-12 10:06:54 +02:00
|
|
|
|
2016-06-20 11:02:31 +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-24 21:58:06 +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-24 21:58:06 +02:00
|
|
|
|
|
|
|
# show tools
|
2017-05-23 12:25:41 +02:00
|
|
|
RUN rustc -vV && cargo -V
|
2016-06-24 21:58:06 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
# build OpenEthereum
|
|
|
|
ADD . /build/openethereum
|
|
|
|
RUN cd openethereum && \
|
2016-06-24 21:58:06 +02:00
|
|
|
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 && \
|
2020-09-22 14:53:52 +02:00
|
|
|
ls /build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum && \
|
|
|
|
/usr/bin/arm-linux-gnueabihf-strip /build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum
|
2016-08-12 09:18:42 +02:00
|
|
|
|
2020-09-22 14:53:52 +02:00
|
|
|
RUN file /build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum
|
2016-08-12 09:18:42 +02:00
|
|
|
|
|
|
|
EXPOSE 8080 8545 8180
|
2020-09-22 14:53:52 +02:00
|
|
|
ENTRYPOINT ["/build/openethereum/target/armv7-unknown-linux-gnueabihf/release/openethereum"]
|