feat: optimize Dockerfile by deferring arduino-cli core installations to entrypoint.sh for a smaller image size

pull/70/head
David Montero Crespo 2026-03-24 18:20:38 -03:00
parent d12a2ad7e4
commit 8f0c23c857
1 changed files with 4 additions and 12 deletions

View File

@ -77,18 +77,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh \
| BINDIR=/usr/local/bin sh
# Initialize arduino-cli config, add board manager URLs, then install cores
# - RP2040: earlephilhower fork for Raspberry Pi Pico
# - ESP32: Espressif official (covers ESP32, ESP32-S3, ESP32-C3, etc.)
RUN arduino-cli config init \
&& arduino-cli config add board_manager.additional_urls \
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json \
&& arduino-cli config add board_manager.additional_urls \
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json \
&& arduino-cli core update-index \
&& arduino-cli core install arduino:avr \
&& arduino-cli core install rp2040:rp2040 \
&& arduino-cli core install esp32:esp32
# Only install arduino-cli binary here. Core installation (arduino:avr,
# rp2040:rp2040, esp32:esp32) is done at first boot by entrypoint.sh
# and persisted in the mounted /root/.arduino15 volume.
# This keeps the image small (~500MB vs ~2.5GB) and builds fast.
WORKDIR /app