|
1 | 1 | FROM ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
|
2 | 2 |
|
3 |
| -ARG RUST_STABLE_VERSION=1.83.0 |
4 |
| -ARG RUST_NIGHTLY_VERSION=nightly-2024-12-01 |
5 |
| - |
6 |
| -ENV RUST_STABLE=$RUST_STABLE_VERSION |
7 |
| -ENV RUST_NIGHTLY=$RUST_NIGHTLY_VERSION |
| 3 | +ENV RUST_STABLE=1.83.0 |
| 4 | +ENV RUST_NIGHTLY=nightly-2024-12-01 |
8 | 5 |
|
9 | 6 | # Add curl for Rust buildchain
|
10 |
| -RUN apk add --update-cache --upgrade curl |
| 7 | +RUN apt install -y --no-install-recommends curl |
11 | 8 |
|
12 | 9 | # Define rustup/cargo home directories
|
13 |
| -ENV RUSTUP_HOME=/opt/rustup \ |
14 |
| - CARGO_HOME=/opt/.cargo |
15 |
| - |
16 |
| -RUN apk add rustup |
| 10 | +ENV RUSTUP_HOME=/opt/rustup |
| 11 | +ENV CARGO_HOME=/opt/.cargo |
17 | 12 |
|
18 | 13 | # Adding cargo binaries to PATH
|
19 |
| -ENV PATH=${CARGO_HOME}/bin:${PATH} |
| 14 | +ENV PATH=${PATH}:${CARGO_HOME}/bin |
20 | 15 |
|
21 |
| -# Installing rustup and setting the default toolchain to the RUST_STABLE_VERSION channel. |
22 |
| -RUN rustup-init --default-toolchain $RUST_STABLE_VERSION -y |
| 16 | +# Installing rustup and setting the default toolchain to the RUST_STABLE channel. |
| 17 | +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain $RUST_STABLE -y |
23 | 18 |
|
24 |
| -# Installing nightly channel version RUST_NIGHTLY_VERSION (for Rust applications). |
25 |
| -RUN rustup install $RUST_NIGHTLY_VERSION |
| 19 | +# Installing nightly channel version RUST_NIGHTLY (for Rust applications). |
| 20 | +RUN rustup install $RUST_NIGHTLY |
26 | 21 |
|
27 | 22 | # Adding ARMV6M target to the installed stable and nightly toolchains
|
28 |
| -RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_STABLE_VERSION |
29 |
| -RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_NIGHTLY_VERSION |
| 23 | +RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_STABLE |
| 24 | +RUN rustup target add thumbv6m-none-eabi --toolchain $RUST_NIGHTLY |
30 | 25 |
|
31 | 26 | # Adding rust-src component to nightly and stable channels
|
32 |
| -RUN rustup component add rust-src --toolchain $RUST_NIGHTLY_VERSION |
33 |
| -RUN rustup component add rust-src --toolchain $RUST_STABLE_VERSION |
34 |
| - |
35 |
| -# Python packages building dependencies, can be removed afterwards |
36 |
| -RUN apk add -t python_build_deps python3-dev \ |
37 |
| - libffi-dev |
| 27 | +RUN rustup component add rust-src --toolchain $RUST_NIGHTLY |
| 28 | +RUN rustup component add rust-src --toolchain $RUST_STABLE |
38 | 29 |
|
39 | 30 | # Install ledgerctl, which is used by cargo ledger for loading or dumping an APDU app file.
|
40 |
| -RUN pip3 install --no-cache-dir ledgerwallet==0.5.2 |
41 |
| - |
42 |
| -# Cleanup, remove packages that aren't needed anymore |
43 |
| -RUN apk del python_build_deps |
| 31 | +RUN pip3 install --break-system-packages --no-cache-dir ledgerwallet==0.5.2 |
44 | 32 |
|
45 | 33 | # Add cargo ledger
|
46 |
| -RUN cargo +$RUST_STABLE_VERSION install --version 1.7.0 cargo-ledger |
| 34 | +RUN cargo +$RUST_STABLE install --version 1.7.0 cargo-ledger |
47 | 35 |
|
48 | 36 | # Setup cargo ledger (install JSON target files and custom link script) for nightly
|
49 | 37 | RUN cargo ledger setup
|
|
0 commit comments