Skip to content

Commit

Permalink
add Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
overcat committed May 21, 2024
1 parent 4f9ba74 commit c37df3c
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -95,6 +87,34 @@ 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

# 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

ENV CARGO_HOME=/opt/.cargo
# Adding cargo binaries to PATH
ENV PATH=${CARGO_HOME}/bin:${PATH}

# 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=

Expand Down

0 comments on commit c37df3c

Please sign in to comment.