diff --git a/Dockerfile b/Dockerfile index a03b5c1..7701a7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,12 +5,9 @@ FROM ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get upgrade -qy && apt-get install -qy \ - apt-utils \ - ca-certificates\ - locales \ clang \ clang-tools \ - clang-format \ + llvm \ lld \ cmake \ curl \ @@ -21,17 +18,12 @@ RUN apt-get update && apt-get upgrade -qy && apt-get install -qy \ libcmocka0 \ libcmocka-dev \ make \ - protobuf-compiler \ - python-is-python3 \ python3 \ python3-pip \ - python3-pyqt5 \ nodejs \ npm \ fish \ - gcc-arm-linux-gnueabihf \ - qemu-user-static \ - gdb-multiarch && \ + qemu-user-static && \ apt-get autoclean -y && \ apt-get autoremove -y && \ apt-get clean @@ -95,6 +87,37 @@ ENV BOLOS_SDK=$NANOS_SDK RUN pip3 install --no-cache-dir --break-system-packages ledgerblue speculos==0.9.0 +ARG RUST_STABLE_VERSION=1.75.0 +ARG RUST_NIGHTLY_VERSION=nightly-2023-11-10 +ENV RUST_STABLE=$RUST_STABLE_VERSION +ENV RUST_NIGHTLY=$RUST_NIGHTLY_VERSION + +ENV CARGO_HOME=/opt/.cargo +ENV RUSTUP_HOME=/opt/rustup +# Adding cargo binaries to PATH +ENV PATH=${CARGO_HOME}/bin:${PATH} + +# Installing rustup to manage rust toolchains and setting the default toolchain to the RUST_STABLE_VERSION stable channel. +RUN curl https://sh.rustup.rs -sSf | \ + sh -s -- --default-toolchain $RUST_STABLE_VERSION -y + +# Installing nightly channel version RUST_NIGHTLY_VERSION +RUN rustup install $RUST_NIGHTLY_VERSION + +# Adding ARMV6M target to the installed stable toolchain +RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_STABLE_VERSION +RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_NIGHTLY_VERSION + +# Adding rust-src component to nightly and stable channels +RUN rustup component add rust-src --toolchain $RUST_NIGHTLY_VERSION +RUN rustup component add rust-src --toolchain $RUST_STABLE_VERSION + +# Add cargo ledger +RUN cargo +$RUST_STABLE_VERSION install --version 1.3.0 cargo-ledger + +# Setup cargo ledger (install JSON target files and custom link script) +RUN cargo +$RUST_NIGHTLY_VERSION ledger setup + # Switch back to dialog for any ad-hoc use of apt-get ENV DEBIAN_FRONTEND=