Skip to content

Instantly share code, notes, and snippets.

@nfraprado
Created August 17, 2025 13:30
Show Gist options
  • Select an option

  • Save nfraprado/62405a480110587a753f895bc15487b1 to your computer and use it in GitHub Desktop.

Select an option

Save nfraprado/62405a480110587a753f895bc15487b1 to your computer and use it in GitHub Desktop.
FROM archlinux:latest
# Install dependencies
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm \
arduino-cli \
python
# Create a non-root user
RUN useradd -m dockeruser && \
echo "dockeruser ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER dockeruser
WORKDIR /home/dockeruser/
# Setup Arduino CLI with ESP32 and Watchy support
RUN arduino-cli config init && \
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json && \
arduino-cli config set network.connection_timeout 600s && \
arduino-cli core update-index && \
arduino-cli core install esp32:esp32 && \
arduino-cli lib install Watchy
# Auto compile and upload, with configurable port
ENTRYPOINT ["bash", "-c", "\
cd $DIR && \
arduino-cli compile \
--fqbn esp32:esp32:esp32s3 \
--build-property=build.flash_size=8MB \
--build-property=build.partitions=default_8MB \
--build-property=upload.maximum_size=3342336 && \
arduino-cli upload \
--fqbn esp32:esp32:esp32s3 \
-p ${TTY:-/dev/ttyACM0}"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment