-
-
Notifications
You must be signed in to change notification settings - Fork 187
Expand file tree
/
Copy pathDockerfile.ChibiOS-RP.SRC
More file actions
113 lines (93 loc) · 4.39 KB
/
Dockerfile.ChibiOS-RP.SRC
File metadata and controls
113 lines (93 loc) · 4.39 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
FROM ubuntu:latest AS downloader
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils \
&& apt-get install -y \
curl \
xz-utils \
unzip \
wget
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted
ARG GCC_VERSION=13.3.rel1
ARG GCC_URI=https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu/$GCC_VERSION/binrel/arm-gnu-toolchain-$GCC_VERSION-x86_64-arm-none-eabi.tar.xz
RUN mkdir -p /tmp/dc-downloads /tmp/dc-extracted/gcc \
&& curl -o /tmp/dc-downloads/gcc-arm.tar.xz $GCC_URI \
&& xz -d /tmp/dc-downloads/gcc-arm.tar.xz \
&& tar -xvf /tmp/dc-downloads/gcc-arm.tar -C /tmp/dc-extracted/gcc --strip-components 1 \
&& rm -rf /tmp/dc-extracted/gcc/share/doc/ /tmp/dc-extracted/gcc/share/gcc-arm-none-eabi/samples/
ARG CMAKE_VERSION=3.31.6
ARG CMAKE_SCRIPT=https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-linux-x86_64.sh
RUN wget $CMAKE_SCRIPT \
-q -O /tmp/dc-downloads/cmake-install.sh \
&& chmod u+x /tmp/dc-downloads/cmake-install.sh \
&& mkdir -p /tmp/dc-extracted/cmake \
&& /tmp/dc-downloads/cmake-install.sh --skip-license --prefix=/tmp/dc-extracted/cmake \
&& rm /tmp/dc-downloads/cmake-install.sh
FROM ubuntu:latest AS devcontainer
# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive
# You can set up non-root user
# ARG USERNAME=vscode
# ARG USER_UID=1000
# ARG USER_GID=$USER_UID
# Configure apt and install packages
RUN apt-get update \
&& apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 \
&& apt-get install -y \
git \
git-svn \
subversion \
clang-format \
curl \
ninja-build \
srecord \
python3 \
python3-pip \
libusb-1.0-0-dev \
pkg-config \
build-essential
# Create needed directories
RUN mkdir -p /usr/local/bin/gcc
# ============================================================
# KEY DIFFERENCE from ChibiOS container:
# Clone ChibiOS master/trunk which has RP2040/RP2350 support
# The stable_21.11.x branch does NOT include RP ports.
# ============================================================
# Try GitHub mirror first (faster), fall back to SVN trunk
RUN git clone --branch master https://github.com/ChibiOS/ChibiOS.git --depth 1 ./sources/ChibiOs \
|| git svn clone http://svn.code.sf.net/p/chibios/code/trunk -rHEAD ./sources/ChibiOs
# NO STM32 Cube packages — not needed for RP targets
# Clone dependent repos (mbedtls, fatfs, littlefs, lwIP)
RUN git clone --branch R0.16 https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
&& git clone --branch v2.11.2 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
&& git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip \
&& git clone --branch mbedtls-3.6.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
&& cd ./sources/mbedtls \
&& git submodule update --init --recursive
# set gcc location
ARG TMP_GCC_PATH=/usr/local/bin/gcc
ENV ARM_GCC_PATH=$TMP_GCC_PATH/bin
# Copy from our other container
COPY --from=downloader /tmp/dc-extracted/gcc $TMP_GCC_PATH
COPY --from=downloader /tmp/dc-extracted/cmake /usr/bin/cmake
ENV PATH=/usr/bin/cmake/bin:${PATH}
# picotool is NOT included — it requires the Pico SDK (PICO_SDK_PATH) to build.
# Since we use ChibiOS (not the Pico SDK), picotool can be added later if UF2
# conversion is needed, by also cloning the pico-sdk.
# hex2dfu is NOT included — RP targets use UF2 format, not DFU
# srecord is still useful for bin packaging
# Install Python dependencies for Kconfig configuration system
RUN pip3 install --no-cache-dir --break-system-packages pyserial "kconfiglib>=14.1.0"
# Clean up downloaded files
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
# Install .NET SDK 9.0 and .NET 8.0 runtime (needed by nanoFramework build tooling)
RUN curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh \
&& chmod +x /tmp/dotnet-install.sh \
&& /tmp/dotnet-install.sh --channel 9.0 --install-dir /usr/share/dotnet \
&& /tmp/dotnet-install.sh --channel 8.0 --runtime dotnet --install-dir /usr/share/dotnet \
&& ln -sf /usr/share/dotnet/dotnet /usr/local/bin/dotnet \
&& rm /tmp/dotnet-install.sh
ENV DOTNET_ROOT=/usr/share/dotnet
# Switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog