From 8f0c23c857a1940dccd18df732b57edcda8af56a Mon Sep 17 00:00:00 2001 From: David Montero Crespo Date: Tue, 24 Mar 2026 18:20:38 -0300 Subject: [PATCH] feat: optimize Dockerfile by deferring arduino-cli core installations to entrypoint.sh for a smaller image size --- Dockerfile.standalone | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/Dockerfile.standalone b/Dockerfile.standalone index 2c314fa..68c2be0 100644 --- a/Dockerfile.standalone +++ b/Dockerfile.standalone @@ -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