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 9325065
Showing 1 changed file with 33 additions and 10 deletions.
43 changes: 33 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,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=

Expand Down

0 comments on commit 9325065

Please sign in to comment.