2020-07-24 08:12:52 +00:00
|
|
|
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
|
2022-06-29 13:35:04 +00:00
|
|
|
RUN wget -q https://sh.rustup.rs -O /tmp/rustup.sh && sh /tmp/rustup.sh -y --profile minimal --default-toolchain nightly -c rust-src --quiet
|
2020-07-24 08:12:52 +00:00
|
|
|
ENV PATH=/home/avr-rust/.cargo/bin:$PATH
|
|
|
|
|
|
|
|
COPY --chown=avr-rust:avr-rust . /code/ruduino
|
|
|
|
|
|
|
|
WORKDIR /code/ruduino
|
2021-01-29 07:25:18 +00:00
|
|
|
ENV AVR_CPU_FREQUENCY_HZ=16000000
|
2020-07-24 08:12:52 +00:00
|
|
|
|
|
|
|
CMD ["cargo", "build", "-Z", "build-std=core", "--target", "avr-atmega328p.json", "--release"]
|