21 lines
600 B
Docker
21 lines
600 B
Docker
|
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
|
||
|
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
|
||
|
ENV PATH=/home/avr-rust/.cargo/bin:$PATH
|
||
|
|
||
|
COPY --chown=avr-rust:avr-rust . /code/ruduino
|
||
|
|
||
|
WORKDIR /code/ruduino
|
||
|
|
||
|
CMD ["cargo", "build", "-Z", "build-std=core", "--target", "avr-atmega328p.json", "--release"]
|