so I have a Dockerfile that I need to compile parity an ethereum client for ARM architecture.

Attached is the Dockerfile:

FROM ubuntu:16.04
WORKDIR /build
# install tools and dependencies
RUN apt-get -y update && \
apt-get install -y \
curl udev git make g++-4.8-multilib-arm-linux-gnueabihf g++ gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
libc6-dev-armhf-cross wget file ca-certificates libudev-dev cmake build-essential \
binutils-arm-linux-gnueabihf lib32z1-dev gcc-arm* && apt-get clean

# install rustup
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y

# rustup directory
ENV PATH /root/.cargo/bin:$PATH

ENV RUST_TARGETS="arm-unknown-linux-gnueabihf"

# multirust add arm--linux-gnuabhf toolchain
RUN rustup target add armv7-unknown-linux-gnueabihf

# show backtraces

# show tools
RUN rustc -vV && \
cargo -V 

#RUN g++ -L/lib/x86_64-linux-gnu/libudev.so -ludev /root/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/

# build parity
RUN git clone https://github.com/paritytech/parity && \
    cd parity && git pull && \
    mkdir -p .cargo && \
    echo '[target.armv7-unknown-linux-gnueabihf]\n linker = "arm-linux-gnueabihf-gcc"' >>.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

EXPOSE 8080 8545 8180
ENTRYPOINT ["/build/parity/target/armv7-unknown-linux-gnueabihf/release/parity"]

The error I'm getting when building this Dockerfile happens when I'm compiling the library in the cargo build stage:

= note: /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/bin/ld: cannot find -ludev
collect2: error: ld returned 1 exit status
error: aborting due to previous error

I found a thread about why it possibly can't find libudev.so from this thread: https://www.raspberrypi.org/forums/viewtopic.php?t=37658

The solution requires modifying the file libudev.so itself, which I am having difficulties doing using the Dockerfile (cat comes up with some encoding bugs when I try to open the file). Any suggestions?

Here's the dockerhub build: https://cloud.docker.com/repository/registry-1.docker.io/yazanator90/parity-arm/builds/7e804fe3-2d7e-467c-88f1-2458ca17a277

  • Was the commented out g++ line above # build parity in the original dockerfile? – tobyd Dec 31 '18 at 13:04
  • 1
    I added it and commented it out for testing. It was erroring out @tobyd – Yazanator Dec 31 '18 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.