FROM ubuntu:18.04 RUN useradd -m avr-rust # Install dependencies RUN apt-get update -y && apt-get install -y wget gcc binutils gcc-avr avr-libc RUN mkdir -p /code && chown avr-rust:avr-rust /code USER avr-rust # Install Rustup along with nightly # TODO: Unpin from Jan 2021 nightly. The nightlies broke midway through the month. RUN wget -q https://sh.rustup.rs -O /tmp/rustup.sh && sh /tmp/rustup.sh -y --profile minimal --default-toolchain nightly-2021-01-05 -c rust-src --quiet ENV PATH=/home/avr-rust/.cargo/bin:$PATH COPY --chown=avr-rust:avr-rust . /code/ruduino WORKDIR /code/ruduino ENV AVR_CPU_FREQUENCY_HZ=16000000 CMD ["cargo", "build", "-Z", "build-std=core", "--target", "avr-atmega328p.json", "--release"]