|
1 | 1 | FROM ubuntu:24.04 |
2 | 2 |
|
3 | 3 | ARG DEBIAN_FRONTEND=noninteractive |
| 4 | +ARG MRS_TOOLCHAIN_URL="https://github.com/Jiu-xiao/mounriver-toolchain-mirror/releases/download/v240/MRS_Toolchain_Linux_X64_V240.tar.xz" |
4 | 5 |
|
5 | 6 | LABEL maintainer="2592509183@qq.com" |
6 | 7 | LABEL description="This is a Docker Image for XRobot build." |
7 | 8 |
|
8 | 9 | RUN apt update && apt upgrade -y --no-install-recommends && \ |
9 | | -apt install -y --no-install-recommends xz-utils git curl sudo wget zip make && apt install -y net-tools usbutils nano gdb cmake ninja-build file clang-18 clangd clang-tidy gcc g++ python3-tk libgpiod-dev && apt clean |
| 10 | +apt install -y --no-install-recommends xz-utils git curl sudo wget zip make && apt install -y net-tools usbutils nano gdb cmake ninja-build file clang-18 clangd clang-tidy gcc g++ python3-tk libhidapi-hidraw0 libjaylink0 && apt clean |
10 | 11 |
|
11 | 12 | RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 && \ |
12 | 13 | update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100 |
13 | 14 |
|
14 | 15 | RUN sudo mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.bk |
15 | 16 |
|
16 | | -RUN apt install -y --no-install-recommends \ |
17 | | -gawk texinfo bison flex bzip2 zlib1g-dev libgmp-dev libmpfr-dev \ |
18 | | -libexpat-dev autoconf automake autotools-dev \ |
19 | | -python3-tomli libmpc-dev build-essential gperf libtool patchutils \ |
20 | | -bc libglib2.0-dev libslirp-dev ninja-build cmake git && \ |
21 | | -apt clean && \ |
22 | | -git clone https://github.com/riscv-collab/riscv-gnu-toolchain && \ |
23 | | -cd riscv-gnu-toolchain && \ |
24 | | -./configure --with-arch=rv32gc --with-abi=ilp32 \ |
25 | | ---prefix=/opt/riscv-rv32 \ |
26 | | ---with-multilib-generator="rv32imac-ilp32--zicsr*zifencei*zaamo*zalrsc;rv32imafc-ilp32f--zicsr*zifencei*zaamo*zalrsc" && \ |
27 | | -make -j$(nproc) && \ |
28 | | -cd .. && rm -rf riscv-gnu-toolchain |
| 17 | +RUN set -eux; \ |
| 18 | +curl -L --fail --retry 3 -o /tmp/mrs_toolchain.tar.xz "$MRS_TOOLCHAIN_URL"; \ |
| 19 | +mkdir -p /opt/wch-gcc15-v240; \ |
| 20 | +tar -xf /tmp/mrs_toolchain.tar.xz -C /opt/wch-gcc15-v240; \ |
| 21 | +rm -f /tmp/mrs_toolchain.tar.xz; \ |
| 22 | +test -x "/opt/wch-gcc15-v240/Toolchain/RISC-V Embedded GCC15/bin/riscv32-wch-elf-gcc"; \ |
| 23 | +test -x "/opt/wch-gcc15-v240/Toolchain/RISC-V Embedded GCC15/bin/riscv32-wch-elf-g++"; \ |
| 24 | +test -x "/opt/wch-gcc15-v240/OpenOCD/OpenOCD/bin/openocd" |
29 | 25 |
|
30 | | -# 链接 RISC-V 工具链至 PATH |
31 | | -RUN bash -c "ln -s /opt/riscv-rv32/bin/* /usr/bin/" |
| 26 | +RUN bash -c 'ln -sf "/opt/wch-gcc15-v240/Toolchain/RISC-V Embedded GCC15/bin/"* /usr/bin/' && \ |
| 27 | + bash -c 'ln -sf "/opt/wch-gcc15-v240/OpenOCD/OpenOCD/bin/"* /usr/bin/' |
0 commit comments