@@ -42,22 +42,49 @@ RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q
42
42
npm \
43
43
unzip
44
44
45
- RUN mkdir /tools
45
+ RUN mkdir -p /tools
46
46
WORKDIR /tools
47
47
48
48
RUN mkdir -p /tools/nuttx-tools
49
49
RUN curl -s -L https://bitbucket.org/nuttx/tools/get/9ad3e1ee75c7.tar.gz \
50
50
| tar -C nuttx-tools --strip-components=1 -xz
51
51
52
- RUN mkdir bloaty -p \
53
- && git clone --depth 1 --branch v1.1 https://github.com/google/bloaty bloaty \
54
- && cd bloaty \
55
- && cmake -DCMAKE_SYSTEM_PREFIX_PATH=/tools/bloaty \
56
- && make install
52
+ RUN mkdir -p /tools/bloaty \
53
+ && git clone --depth 1 --branch v1.1 https://github.com/google/bloaty bloaty-src \
54
+ && cd bloaty-src \
55
+ && cmake -B build -DCMAKE_INSTALL_PREFIX=/tools/bloaty \
56
+ && cmake --build build \
57
+ && cmake --build build --target install \
58
+ && cd /tools && rm -rf bloaty-src
57
59
58
60
RUN cd nuttx-tools/kconfig-frontends \
59
61
&& ./configure --enable-mconf --disable-gconf --disable-qconf --enable-static --prefix=/tools/kconfig-frontends \
60
- && make install
62
+ && make install && cd /tools && rm -rf nuttx-tools
63
+
64
+ RUN mkdir -p /tools/gn \
65
+ && cd /tools/gn \
66
+ && git clone https://gn.googlesource.com/gn gn \
67
+ && cd gn && ./build/gen.py \
68
+ && cd out && ninja
69
+
70
+ ENV ZAP_INSTALL_PATH=/tools/zap_release
71
+ RUN mkdir -p $ZAP_INSTALL_PATH \
72
+ && cd $ZAP_INSTALL_PATH \
73
+ && curl -s -O -L https://github.com/project-chip/zap/releases/download/v2023.10.09-nightly/zap-linux-x64.zip \
74
+ && unzip zap-linux-x64.zip \
75
+ && rm zap-linux-x64.zip
76
+
77
+ ENV ZAP_DEVELOPMENT_PATH=/tools/zap
78
+ RUN cd /tools \
79
+ && curl -s -O -L https://github.com/project-chip/zap/archive/refs/tags/v2023.10.09-nightly.zip \
80
+ && unzip v2023.10.09-nightly.zip \
81
+ && mv zap-2023.10.09-nightly zap \
82
+ && rm v2023.10.09-nightly.zip \
83
+ && cd zap && npm install cross-spawn folder-hash
84
+
85
+ # ########################
86
+ # Programming languages
87
+ # ########################
61
88
62
89
# Install Rust and targets supported from NuttX
63
90
ENV RUST_HOME=/tools/rust
@@ -70,49 +97,31 @@ RUN mkdir -p $CARGO_HOME \
70
97
&& $CARGO_HOME/bin/rustup target add riscv64gc-unknown-none-elf
71
98
72
99
# Install Swift
73
- ENV SWIFT_VERSION=6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a
74
- ENV SWIFT_HOME=/tools/swift
75
- RUN mkdir -p ${SWIFT_HOME} \
76
- && curl -s -O -L https://download.swift.org/swift-6.0-branch/ubuntu2204/swift-${SWIFT_VERSION}/swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz \
77
- && tar xzf swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz -C ${SWIFT_HOME} \
78
- && rm swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz
100
+ # ENV SWIFT_VERSION=6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a
101
+ # ENV SWIFT_HOME=/tools/swift
102
+ # RUN mkdir -p ${SWIFT_HOME} \
103
+ # && curl -s -O -L https://download.swift.org/swift-6.0-branch/ubuntu2204/swift-${SWIFT_VERSION}/swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz \
104
+ # && tar xzf swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz -C ${SWIFT_HOME} \
105
+ # && rm swift-${SWIFT_VERSION}-ubuntu22.04.tar.gz
79
106
80
107
# Install Zig latest release
81
108
ENV ZIG_VERSION=0.13.0
82
109
ENV ZIG_HOME=/tools/zig
83
110
RUN mkdir -p ${ZIG_HOME} \
84
- && curl -s -O -L https://github.com/marler8997/zigup/releases/download/v2024_05_05/zigup-x86_64-linux.tar.gz \
85
- && tar xzf zigup-x86_64-linux.tar.gz -C ${ZIG_HOME} \
86
- && rm zigup-x86_64-linux.tar.gz \
87
- && chmod +x ${ZIG_HOME}/zigup \
88
- && ${ZIG_HOME}/zigup fetch --install-dir ${ZIG_HOME} ${ZIG_VERSION} \
89
- && chmod +x ${ZIG_HOME}/${ZIG_VERSION}/files/zig
90
-
111
+ && curl -s -O -L https://github.com/marler8997/zigup/releases/download/v2024_05_05/zigup-x86_64-linux.tar.gz \
112
+ && tar xzf zigup-x86_64-linux.tar.gz -C ${ZIG_HOME} \
113
+ && rm zigup-x86_64-linux.tar.gz \
114
+ && chmod +x ${ZIG_HOME}/zigup \
115
+ && ${ZIG_HOME}/zigup fetch --install-dir ${ZIG_HOME} ${ZIG_VERSION} \
116
+ && chmod +x ${ZIG_HOME}/${ZIG_VERSION}/files/zig
91
117
92
118
# Install LDC2 latest release
93
119
ENV LDC_VERSION=1.39.0
94
120
ENV D_HOME=/tools/ldc2
95
121
RUN mkdir -p ${D_HOME} \
96
- && curl -s -O -L https://github.com/ldc-developers/ldc/releases/download/v${LDC_VERSION}/ldc2-${LDC_VERSION}-linux-x86_64.tar.xz \
97
- && tar xf ldc2-${LDC_VERSION}-linux-x86_64.tar.xz -C ${D_HOME} \
98
- && rm ldc2-${LDC_VERSION}-linux-x86_64.tar.xz
99
-
100
- RUN mkdir /tools/gn -p \
101
- && cd /tools/gn \
102
- && git clone https://gn.googlesource.com/gn gn \
103
- && cd gn && ./build/gen.py && cd out && ninja
104
-
105
- ENV ZAP_INSTALL_PATH=/tools/zap_release
106
- RUN mkdir $ZAP_INSTALL_PATH -p \
107
- && cd $ZAP_INSTALL_PATH \
108
- && curl -s -O -L https://github.com/project-chip/zap/releases/download/v2023.10.09-nightly/zap-linux-x64.zip \
109
- && unzip zap-linux-x64.zip
110
-
111
- ENV ZAP_DEVELOPMENT_PATH=/tools/zap
112
- RUN cd /tools \
113
- && curl -s -O -L https://github.com/project-chip/zap/archive/refs/tags/v2023.10.09-nightly.zip \
114
- && unzip v2023.10.09-nightly.zip && mv zap-2023.10.09-nightly zap \
115
- && cd zap && npm install cross-spawn folder-hash
122
+ && curl -s -O -L https://github.com/ldc-developers/ldc/releases/download/v${LDC_VERSION}/ldc2-${LDC_VERSION}-linux-x86_64.tar.xz \
123
+ && tar xf ldc2-${LDC_VERSION}-linux-x86_64.tar.xz -C ${D_HOME} \
124
+ && rm ldc2-${LDC_VERSION}-linux-x86_64.tar.xz
116
125
117
126
CMD [ "/bin/bash" ]
118
127
@@ -121,22 +130,22 @@ CMD [ "/bin/bash" ]
121
130
# ##############################################################################
122
131
FROM builder-base AS nuttx-toolchain-base
123
132
124
- RUN mkdir /tools
133
+ RUN mkdir -p /tools
125
134
WORKDIR /tools
126
135
127
136
# ##############################################################################
128
137
# Build image for tool required by ARM builds
129
138
# ##############################################################################
130
139
FROM nuttx-toolchain-base AS nuttx-toolchain-arm
131
140
# Download the latest ARM clang toolchain prebuilt by ARM
132
- RUN mkdir clang-arm-none-eabi && \
141
+ RUN mkdir -p clang-arm-none-eabi && \
133
142
curl -s -L "https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-17.0.1/LLVMEmbeddedToolchainForArm-17.0.1-Linux-x86_64.tar.xz" \
134
- | tar -C clang-arm-none-eabi --strip-components 1 -xJ
143
+ | tar -C clang-arm-none-eabi --strip-components= 1 -xJ
135
144
136
145
# Download the latest ARM GCC toolchain prebuilt by ARM
137
- RUN mkdir gcc-arm-none-eabi && \
146
+ RUN mkdir -p gcc-arm-none-eabi && \
138
147
curl -s -L "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.Rel1/binrel/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi.tar.xz" \
139
- | tar -C gcc-arm-none-eabi --strip-components 1 -xJ
148
+ | tar -C gcc-arm-none-eabi --strip-components= 1 -xJ
140
149
141
150
# ##############################################################################
142
151
# Build image for tool required by ARM64 builds
@@ -145,7 +154,7 @@ FROM nuttx-toolchain-base AS nuttx-toolchain-arm64
145
154
# Download the latest ARM64 GCC toolchain prebuilt by ARM
146
155
RUN mkdir gcc-aarch64-none-elf && \
147
156
curl -s -L "https://developer.arm.com/-/media/Files/downloads/gnu/13.2.Rel1/binrel/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-elf.tar.xz" \
148
- | tar -C gcc-aarch64-none-elf --strip-components 1 -xJ
157
+ | tar -C gcc-aarch64-none-elf --strip-components= 1 -xJ
149
158
150
159
# ##############################################################################
151
160
# Build image for tool required by AVR32 builds
@@ -164,7 +173,7 @@ RUN mkdir -p gcc-avr32-gnu && \
164
173
FROM nuttx-toolchain-base AS nuttx-toolchain-pinguino
165
174
# Download the pinguino compilers. Note this includes both 8bit and 32bit
166
175
# toolchains and builds for multiple host systems. Only copy what is needed.
167
- RUN mkdir pinguino-compilers && \
176
+ RUN mkdir -p pinguino-compilers && \
168
177
curl -s -L "https://github.com/PinguinoIDE/pinguino-compilers/archive/62db5158d7f6d41c6fadb05de81cc31dd81a1958.tar.gz" \
169
178
| tar -C pinguino-compilers --strip-components=2 --wildcards -xz */linux64
170
179
@@ -224,25 +233,25 @@ RUN cd renesas-tools/source/newlib && \
224
233
/tools/renesas-tools/source/newlib/configure --target=rx-elf --prefix=/tools/renesas-toolchain/rx-elf-gcc && \
225
234
make && make install
226
235
RUN cd /tools/renesas-tools/build/gcc && \
227
- make && make install
236
+ make && make install && cd /tools && rm -rf renesas-tools
228
237
229
238
# ##############################################################################
230
239
# Build image for tool required by RISCV builds
231
240
# ##############################################################################
232
241
FROM nuttx-toolchain-base AS nuttx-toolchain-riscv
233
242
# Download the latest RISCV GCC toolchain prebuilt by xPack
234
- RUN mkdir riscv-none-elf-gcc && \
243
+ RUN mkdir -p riscv-none-elf-gcc && \
235
244
curl -s -L "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz" \
236
- | tar -C riscv-none-elf-gcc --strip-components 1 -xz
245
+ | tar -C riscv-none-elf-gcc --strip-components= 1 -xz
237
246
238
247
# ##############################################################################
239
248
# Build image for tool required by SPARC builds
240
249
# ##############################################################################
241
250
FROM nuttx-toolchain-base AS nuttx-toolchain-sparc
242
251
# Download the SPARC GCC toolchain prebuilt by Gaisler
243
- RUN mkdir sparc-gaisler-elf-gcc && \
252
+ RUN mkdir -p sparc-gaisler-elf-gcc && \
244
253
curl -s -L "https://www.gaisler.com/anonftp/bcc2/bin/bcc-2.1.0-gcc-linux64.tar.xz" \
245
- | tar -C sparc-gaisler-elf-gcc --strip-components 1 -xJ
254
+ | tar -C sparc-gaisler-elf-gcc --strip-components= 1 -xJ
246
255
247
256
# ##############################################################################
248
257
# Build image for tool required by ESP32 builds
@@ -251,15 +260,15 @@ FROM nuttx-toolchain-base AS nuttx-toolchain-esp32
251
260
# Download the latest ESP32 GCC toolchain prebuilt by Espressif
252
261
RUN mkdir -p xtensa-esp32-elf-gcc && \
253
262
curl -s -L "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz" \
254
- | tar -C xtensa-esp32-elf-gcc --strip-components 1 -xJ
263
+ | tar -C xtensa-esp32-elf-gcc --strip-components= 1 -xJ
255
264
256
265
RUN mkdir -p xtensa-esp32s2-elf-gcc && \
257
266
curl -s -L "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s2-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz" \
258
- | tar -C xtensa-esp32s2-elf-gcc --strip-components 1 -xJ
267
+ | tar -C xtensa-esp32s2-elf-gcc --strip-components= 1 -xJ
259
268
260
269
RUN mkdir -p xtensa-esp32s3-elf-gcc && \
261
270
curl -s -L "https://github.com/espressif/crosstool-NG/releases/download/esp-12.2.0_20230208/xtensa-esp32s3-elf-12.2.0_20230208-x86_64-linux-gnu.tar.xz" \
262
- | tar -C xtensa-esp32s3-elf-gcc --strip-components 1 -xJ
271
+ | tar -C xtensa-esp32s3-elf-gcc --strip-components= 1 -xJ
263
272
264
273
RUN echo "ESP Binaries: 2022/01/26"
265
274
RUN mkdir -p /tools/blobs && cd /tools/blobs \
@@ -277,12 +286,12 @@ RUN mkdir -p /tools/blobs && cd /tools/blobs \
277
286
# ##############################################################################
278
287
FROM nuttx-toolchain-base AS nuttx-toolchain-wasm
279
288
# Download the latest WASI-enabled WebAssembly C/C++ toolchain prebuilt by WASM
280
- RUN mkdir wasi-sdk && \
289
+ RUN mkdir -p wasi-sdk && \
281
290
curl -s -L "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-19/wasi-sdk-19.0-linux.tar.gz" \
282
- | tar -C wasi-sdk --strip-components 1 -xz
291
+ | tar -C wasi-sdk --strip-components= 1 -xz
283
292
284
293
# Download the latest "wamrc" AOT compiler prebuilt by WAMR
285
- RUN mkdir wamrc && \
294
+ RUN mkdir -p wamrc && \
286
295
curl -s -L "https://github.com/bytecodealliance/wasm-micro-runtime/releases/download/WAMR-1.1.2/wamrc-1.1.2-x86_64-ubuntu-20.04.tar.gz" \
287
296
| tar -C wamrc -xz
288
297
@@ -301,8 +310,8 @@ RUN apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -q
301
310
302
311
RUN mkdir -p cmake && \
303
312
curl -s -L wget https://cmake.org/files/v3.26/cmake-3.26.0.tar.gz \
304
- | tar -C cmake --strip-components=1 -xz && \
305
- cd cmake && ./bootstrap && make && make install && rm -rf cmake
313
+ | tar -C cmake --strip-components=1 -xz \
314
+ && cd cmake && ./bootstrap && make && make install && rm -rf cmake
306
315
307
316
RUN dpkg --add-architecture i386
308
317
# This is used for the final images so make sure to not store apt cache
@@ -396,7 +405,7 @@ RUN npm install -g n && n stable && hash -r
396
405
397
406
# Used to generate symbol table files
398
407
399
- RUN mkdir /tools
408
+ RUN mkdir -p /tools
400
409
WORKDIR /tools
401
410
402
411
# Pull in the tools we just built for nuttx
@@ -420,14 +429,15 @@ COPY --from=nuttx-tools /tools/ldc2/ /tools/ldc2/
420
429
ENV PATH="/tools/ldc2/ldc2-1.39.0-linux-x86_64/bin:$PATH"
421
430
422
431
# Pull in the swift 6.0 toolchain
423
- COPY --from=nuttx-tools /tools/swift/ /tools/swift/
424
- ENV PATH="/tools/swift/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a/bin:$PATH"
432
+ # COPY --from=nuttx-tools /tools/swift/ /tools/swift/
433
+ # ENV PATH="/tools/swift/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-22-a/bin:$PATH"
425
434
426
- # ARM toolchain
435
+ # ARM clang toolchain
427
436
COPY --from=nuttx-toolchain-arm /tools/clang-arm-none-eabi/ clang-arm-none-eabi/
428
437
# RUN cp /usr/bin/clang-extdef-mapping-10 clang-arm-none-eabi/bin/clang-extdef-mapping
429
438
ENV PATH="/tools/clang-arm-none-eabi/bin:$PATH"
430
439
440
+ # ARM GCC toolchain
431
441
COPY --from=nuttx-toolchain-arm /tools/gcc-arm-none-eabi/ gcc-arm-none-eabi/
432
442
ENV PATH="/tools/gcc-arm-none-eabi/bin:$PATH"
433
443
0 commit comments