Skip to content

Commit 9325065

Browse files
committed
add Rust
1 parent 4f9ba74 commit 9325065

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

Dockerfile

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@ FROM ubuntu:24.04
55
ENV DEBIAN_FRONTEND=noninteractive
66

77
RUN apt-get update && apt-get upgrade -qy && apt-get install -qy \
8-
apt-utils \
9-
ca-certificates\
10-
locales \
118
clang \
129
clang-tools \
13-
clang-format \
10+
llvm \
1411
lld \
1512
cmake \
1613
curl \
@@ -21,17 +18,12 @@ RUN apt-get update && apt-get upgrade -qy && apt-get install -qy \
2118
libcmocka0 \
2219
libcmocka-dev \
2320
make \
24-
protobuf-compiler \
25-
python-is-python3 \
2621
python3 \
2722
python3-pip \
28-
python3-pyqt5 \
2923
nodejs \
3024
npm \
3125
fish \
32-
gcc-arm-linux-gnueabihf \
33-
qemu-user-static \
34-
gdb-multiarch && \
26+
qemu-user-static && \
3527
apt-get autoclean -y && \
3628
apt-get autoremove -y && \
3729
apt-get clean
@@ -95,6 +87,37 @@ ENV BOLOS_SDK=$NANOS_SDK
9587

9688
RUN pip3 install --no-cache-dir --break-system-packages ledgerblue speculos==0.9.0
9789

90+
ARG RUST_STABLE_VERSION=1.75.0
91+
ARG RUST_NIGHTLY_VERSION=nightly-2023-11-10
92+
ENV RUST_STABLE=$RUST_STABLE_VERSION
93+
ENV RUST_NIGHTLY=$RUST_NIGHTLY_VERSION
94+
95+
ENV CARGO_HOME=/opt/.cargo
96+
ENV RUSTUP_HOME=/opt/rustup
97+
# Adding cargo binaries to PATH
98+
ENV PATH=${CARGO_HOME}/bin:${PATH}
99+
100+
# Installing rustup to manage rust toolchains and setting the default toolchain to the RUST_STABLE_VERSION stable channel.
101+
RUN curl https://sh.rustup.rs -sSf | \
102+
sh -s -- --default-toolchain $RUST_STABLE_VERSION -y
103+
104+
# Installing nightly channel version RUST_NIGHTLY_VERSION
105+
RUN rustup install $RUST_NIGHTLY_VERSION
106+
107+
# Adding ARMV6M target to the installed stable toolchain
108+
RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_STABLE_VERSION
109+
RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_NIGHTLY_VERSION
110+
111+
# Adding rust-src component to nightly and stable channels
112+
RUN rustup component add rust-src --toolchain $RUST_NIGHTLY_VERSION
113+
RUN rustup component add rust-src --toolchain $RUST_STABLE_VERSION
114+
115+
# Add cargo ledger
116+
RUN cargo +$RUST_STABLE_VERSION install --version 1.3.0 cargo-ledger
117+
118+
# Setup cargo ledger (install JSON target files and custom link script)
119+
RUN cargo +$RUST_NIGHTLY_VERSION ledger setup
120+
98121
# Switch back to dialog for any ad-hoc use of apt-get
99122
ENV DEBIAN_FRONTEND=
100123

0 commit comments

Comments
 (0)