Skip to content

Commit c2942a1

Browse files
committed
更新 Webots 与 CH32 基础镜像
1 parent bd81d72 commit c2942a1

2 files changed

Lines changed: 25 additions & 17 deletions

File tree

ch32-riscv/Dockerfile

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,27 @@
11
FROM ubuntu:24.04
22

33
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"
45

56
LABEL maintainer="2592509183@qq.com"
67
LABEL description="This is a Docker Image for XRobot build."
78

89
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
1011

1112
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100 && \
1213
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
1314

1415
RUN sudo mv /usr/lib/python3.12/EXTERNALLY-MANAGED /usr/lib/python3.12/EXTERNALLY-MANAGED.bk
1516

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"
2925

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/'

webots/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RUN apt-get update && \
1414
clang-18 clangd clang-tidy \
1515
gcc g++ \
1616
python3 python3-venv python3-tk \
17-
libwpa-client-dev libnm-dev libudev-dev libgpiod-dev \
17+
libwpa-client-dev libnm-dev libudev-dev \
1818
ca-certificates pkg-config && \
1919
rm -rf /var/lib/apt/lists/*
2020

@@ -32,6 +32,18 @@ RUN set -eux; \
3232
rm -f /tmp/webots.deb; \
3333
rm -rf /var/lib/apt/lists/*
3434

35+
RUN set -eux; \
36+
wget -O /tmp/openvino.tgz https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.4/linux/openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64.tgz; \
37+
tar -xf /tmp/openvino.tgz -C /tmp; \
38+
mkdir -p /opt/intel; \
39+
mv /tmp/openvino_toolkit_ubuntu24_2025.4.0.20398.8fdad55727d_x86_64 /opt/intel/openvino_2025.4.0; \
40+
ln -sfn /opt/intel/openvino_2025.4.0 /opt/intel/openvino_2025; \
41+
rm -f /tmp/openvino.tgz
42+
43+
ENV OpenVINO_DIR=/opt/intel/openvino_2025.4.0/runtime/cmake
44+
ENV CMAKE_PREFIX_PATH=/opt/intel/openvino_2025.4.0/runtime/cmake:${CMAKE_PREFIX_PATH}
45+
ENV LD_LIBRARY_PATH=/opt/intel/openvino_2025.4.0/runtime/lib/intel64:/usr/local/webots/lib/controller:${LD_LIBRARY_PATH}
46+
3547
RUN set -eux; \
3648
apt-get update; \
3749
apt-get install -y --no-install-recommends \

0 commit comments

Comments
 (0)