blob: 219ece9e1cc6510bd34dc8814a68a443928fe143 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
FROM ubuntu:22.04
ARG HTTP_PROXY
ARG HTTPS_PROXY
ENV http_proxy=${HTTP_PROXY}
ENV https_proxy=${HTTPS_PROXY}
# 1. Basic options(with root)
RUN apt update && \
apt install -y software-properties-common && \
add-apt-repository universe && \
apt update && \
apt install -y --no-install-recommends \
sudo git wget python3 python3-pip scons vim xz-utils minicom && \
pip3 install esptool && \
useradd -m dev && \
echo "dev ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# 2. Switch to dev user
USER dev
WORKDIR /home/dev
# 3. Install esp-idf toolchains
RUN wget -q https://github.com/espressif/crosstool-NG/releases/download/esp-15.2.0_20251204/riscv32-esp-elf-15.2.0_20251204-x86_64-linux-gnu.tar.xz && \
sudo tar -xf riscv32-esp-elf-15.2.0_20251204-x86_64-linux-gnu.tar.xz -C /opt
# 4. Clone RT-Thread and switch master
RUN git clone https://github.com/RT-Thread/rt-thread.git && \
cd rt-thread && \
git switch master
# 5. Install env tools
WORKDIR /home/dev/rt-thread
RUN wget https://raw.githubusercontent.com/RT-Thread/env/master/install_ubuntu.sh && \
chmod +x install_ubuntu.sh && \
./install_ubuntu.sh
# 6. Modify toolchains path
RUN sed -i "s|^.*EXEC_PATH.*| EXEC_PATH = r'/opt/riscv32-esp-elf/bin'|" bsp/ESP32_C3/rtconfig.py
# 7. Set enviroment variables
ENV PATH="/opt/riscv32-esp-elf/bin:/home/dev/.env/tools/scripts:$PATH"
# 8. Update rtthread packages
WORKDIR /home/dev/rt-thread/bsp/ESP32_C3
RUN pkgs --update
|