diff --git a/packaging/Dockerfile.build_env b/packaging/Dockerfile.build_env index 5e05bf8331c3..cc2b07466d25 100644 --- a/packaging/Dockerfile.build_env +++ b/packaging/Dockerfile.build_env @@ -14,6 +14,10 @@ RUN mkdir -p /artifacts && chown -R builder:builder /artifacts USER builder +# Define Rust compiler +ENV RUSTUP_HOME=/opt/rust CARGO_HOME=/home/builder/.cargo +ENV PATH=$PATH:/opt/rust/bin + VOLUME /px4-firmware/sources WORKDIR /px4-firmware/sources diff --git a/packaging/Dockerfile.build_env_pre b/packaging/Dockerfile.build_env_pre index dd0e2e08835a..920d4e1f763d 100644 --- a/packaging/Dockerfile.build_env_pre +++ b/packaging/Dockerfile.build_env_pre @@ -25,6 +25,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ RUN mkdir -p /tools +# Install Rust compiler +ENV RUSTUP_HOME /opt/rust +ENV CARGO_HOME /opt/rust +RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --no-modify-path +RUN /opt/rust/bin/rustup target add riscv64gc-unknown-none-elf + RUN curl -LOs https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.12/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz && \ tar xf riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz -C /tools && \ rm -f riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz