2018-10-31 13:39:18 +01:00
|
|
|
FROM ubuntu:xenial
|
2016-06-24 22:51:05 +02:00
|
|
|
WORKDIR /build
|
2017-05-23 12:25:41 +02:00
|
|
|
|
2018-10-31 13:39:18 +01:00
|
|
|
# install aarch64(armv8) dependencies and tools
|
|
|
|
RUN dpkg --add-architecture arm64
|
|
|
|
RUN echo '# source urls for arm64 \n\
|
|
|
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial main \n\
|
|
|
|
deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial main \n\
|
|
|
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main \n\
|
|
|
|
deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-updates main \n\
|
|
|
|
deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-security main \n\
|
|
|
|
deb-src [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ xenial-security main \n # end arm64 section' >> /etc/apt/sources.list &&\
|
|
|
|
sed -r 's/deb h/deb \[arch=amd64\] h/g' /etc/apt/sources.list > /tmp/sources-tmp.list && \
|
|
|
|
cp /tmp/sources-tmp.list /etc/apt/sources.list&& \
|
|
|
|
sed -r 's/deb-src h/deb-src \[arch=amd64\] h/g' /etc/apt/sources.list > /tmp/sources-tmp.list&&cat /etc/apt/sources.list &&\
|
|
|
|
cp /tmp/sources-tmp.list /etc/apt/sources.list&& echo "next"&&cat /etc/apt/sources.list
|
|
|
|
|
2016-06-24 22:51:05 +02:00
|
|
|
# install tools and dependencies
|
|
|
|
RUN apt-get -y update && \
|
2018-10-31 13:39:18 +01:00
|
|
|
apt-get upgrade -y && \
|
|
|
|
apt-get install -y --no-install-recommends \
|
2020-03-25 17:16:51 +01:00
|
|
|
curl make cmake file ca-certificates \
|
|
|
|
g++ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
|
|
|
|
libc6-dev-arm64-cross binutils-aarch64-linux-gnu \
|
|
|
|
&& \
|
2018-10-31 13:39:18 +01:00
|
|
|
apt-get clean
|
2016-06-24 22:51:05 +02:00
|
|
|
|
|
|
|
# install rustup
|
|
|
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
|
|
|
|
|
|
|
# rustup directory
|
|
|
|
ENV PATH /root/.cargo/bin:$PATH
|
|
|
|
|
|
|
|
ENV RUST_TARGETS="aarch64-unknown-linux-gnu"
|
|
|
|
|
|
|
|
# multirust add arm--linux-gnuabhf toolchain
|
|
|
|
RUN rustup target add aarch64-unknown-linux-gnu
|
|
|
|
|
|
|
|
# show backtraces
|
|
|
|
ENV RUST_BACKTRACE 1
|
|
|
|
|
|
|
|
# show tools
|
2017-05-23 12:25:41 +02:00
|
|
|
RUN rustc -vV && cargo -V
|
2016-06-24 22:51:05 +02:00
|
|
|
|
2020-03-25 17:16:51 +01:00
|
|
|
# build OpenEthereum
|
|
|
|
ADD . /build/openethereum
|
|
|
|
RUN cd openethereum && \
|
2018-10-31 13:39:18 +01:00
|
|
|
mkdir -p .cargo && \
|
|
|
|
echo '[target.aarch64-unknown-linux-gnu]\n\
|
|
|
|
linker = "aarch64-linux-gnu-gcc"\n'\
|
|
|
|
>>.cargo/config && \
|
|
|
|
cat .cargo/config && \
|
|
|
|
cargo build --target aarch64-unknown-linux-gnu --release --verbose && \
|
2020-03-25 17:16:51 +01:00
|
|
|
ls /build/openethereum/target/aarch64-unknown-linux-gnu/release/openethereum && \
|
|
|
|
/usr/bin/aarch64-linux-gnu-strip /build/openethereum/target/aarch64-unknown-linux-gnu/release/openethereum
|
2016-08-12 09:18:42 +02:00
|
|
|
|
2020-03-25 17:16:51 +01:00
|
|
|
RUN file /build/openethereum/target/aarch64-unknown-linux-gnu/release/openethereum
|
2016-08-12 09:18:42 +02:00
|
|
|
|
|
|
|
EXPOSE 8080 8545 8180
|
2020-03-25 17:16:51 +01:00
|
|
|
ENTRYPOINT ["/build/openethereum/target/aarch64-unknown-linux-gnu/release/openethereum"]
|