-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
29 lines (23 loc) · 950 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM ubuntu:focal
RUN set -eux; \
groupadd -g 1005 builder; \
useradd -g builder -u 1005 -m -s /bin/bash builder
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends \
# for Docker
gosu curl ca-certificates \
# for makefile
jq make \
# for rust's libcore
gcc libc6-dev
RUN set -eux; \
gosu builder mkdir /home/builder/arduboy-hello-rs; \
gosu builder mkdir /home/builder/bin
RUN set -eux; \
gosu builder bash -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"; \
gosu builder bash -c "curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=/home/builder/bin sh"
COPY --chown=builder:builder Cargo.toml Makefile arduboy-hello-rs.ino hello.rs /home/builder/arduboy-hello-rs/
RUN set -eux; \
cd /home/builder/arduboy-hello-rs; \
gosu builder bash -c 'export PATH="/home/builder/bin:/home/builder/.cargo/bin:$PATH" && make PORT=fake setup && make'