fix(docker-aarch64) : cross-compile config (#9798)
This commit is contained in:
parent
3694b10e22
commit
a898109522
@ -1,14 +1,30 @@
|
|||||||
FROM ubuntu:14.04
|
FROM ubuntu:xenial
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
# install tools and dependencies
|
# install tools and dependencies
|
||||||
RUN apt-get -y update && \
|
RUN apt-get -y update && \
|
||||||
apt-get install -y --force-yes --no-install-recommends \
|
apt-get upgrade -y && \
|
||||||
curl git make g++ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
|
apt-get install -y --no-install-recommends \
|
||||||
libc6-arm64-cross libc6-dev-arm64-cross wget file ca-certificates \
|
curl make cmake file ca-certificates \
|
||||||
binutils-aarch64-linux-gnu cmake3 libudev-dev \
|
g++ gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
|
||||||
&& \
|
libc6-dev-arm64-cross binutils-aarch64-linux-gnu \
|
||||||
apt-get clean
|
libudev-dev libudev-dev:arm64 \
|
||||||
|
&& \
|
||||||
|
apt-get clean
|
||||||
|
|
||||||
# install rustup
|
# install rustup
|
||||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
|
||||||
@ -30,14 +46,14 @@ RUN rustc -vV && cargo -V
|
|||||||
# build parity
|
# build parity
|
||||||
ADD . /build/parity
|
ADD . /build/parity
|
||||||
RUN cd parity && \
|
RUN cd parity && \
|
||||||
mkdir -p .cargo && \
|
mkdir -p .cargo && \
|
||||||
echo '[target.aarch64-unknown-linux-gnu]\n\
|
echo '[target.aarch64-unknown-linux-gnu]\n\
|
||||||
linker = "aarch64-linux-gnu-gcc"\n'\
|
linker = "aarch64-linux-gnu-gcc"\n'\
|
||||||
>>.cargo/config && \
|
>>.cargo/config && \
|
||||||
cat .cargo/config && \
|
cat .cargo/config && \
|
||||||
cargo build --target aarch64-unknown-linux-gnu --release --verbose && \
|
cargo build --target aarch64-unknown-linux-gnu --release --verbose && \
|
||||||
ls /build/parity/target/aarch64-unknown-linux-gnu/release/parity && \
|
ls /build/parity/target/aarch64-unknown-linux-gnu/release/parity && \
|
||||||
/usr/bin/aarch64-linux-gnu-strip /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
/usr/bin/aarch64-linux-gnu-strip /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
||||||
|
|
||||||
RUN file /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
RUN file /build/parity/target/aarch64-unknown-linux-gnu/release/parity
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user