-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
78 lines (69 loc) · 3.04 KB
/
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Copyright (c) 2023-2024 Lawrence Hunter <[email protected]>
# ---------------------------------------------------------------------------- #
# Toolchain base image #
# ---------------------------------------------------------------------------- #
FROM debian:bullseye-slim AS toolchain
WORKDIR /src
ENV DEBIAN_FRONTEND noninteractive
RUN apt update -y && \
apt install -y \
binutils build-essential libtool texinfo \
gzip zip unzip patchutils curl git python3 python3-pip \
make cmake ninja-build automake bison flex gperf \
grep sed gawk python bc wget libgcrypt20-dev \
zlib1g-dev libexpat1-dev libmpc-dev autoconf \
libglib2.0-dev libfdt-dev libpixman-1-dev && \
apt clean
RUN mkdir qemu_bin
RUN git clone https://github.com/qemu/qemu.git && \
cd qemu && \
./configure --target-list=riscv64-softmmu \
--prefix=/src/qemu_bin && \
make -j$(nproc) && \
make install
RUN wget "https://github.com/riscv-collab/riscv-gnu-toolchain/releases/"\
"download/2023.05.27/riscv64-glibc-ubuntu-20.04-nightly"\
"-2023.05.27-nightly.tar.gz" && \
tar -xvf riscv64-glibc-ubuntu-20.04-nightly-2023.05.27-nightly.tar.gz && \
rm riscv64-glibc-ubuntu-20.04-nightly-2023.05.27-nightly.tar.gz
# ---------------------------------------------------------------------------- #
# Minimal rust build image for reduced overhead #
# ---------------------------------------------------------------------------- #
FROM rust:bullseye AS rust-minimal
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
COPY --from=toolchain /src/riscv/bin /usr/bin
COPY --from=toolchain /src/qemu_bin/bin /usr/bin
RUN apt update -y && \
apt install -y make wget python3-pip && \
apt clean
RUN rustup override set nightly && \
rustup target add riscv64gc-unknown-none-elf && \
cargo install cargo-binutils && \
rustup +nightly component add rust-src && \
rustup component add llvm-tools-preview && \
rustup component add clippy
RUN pip3 install pyfiglet pycryptodome
# ---------------------------------------------------------------------------- #
# Full rust image for all functions #
# ---------------------------------------------------------------------------- #
# Split more than it should to prevent Pi crashes
FROM rust:bullseye AS rust-full
ENV DEBIAN_FRONTEND noninteractive
ENV TERM xterm
COPY --from=toolchain /src/riscv/bin /usr/bin
COPY --from=toolchain /src/qemu_bin/bin /usr/bin
RUN apt update -y && \
apt install -y qemu-system make wget graphviz python3-pip && \
apt clean
RUN rustup override set nightly && \
rustup target add riscv64gc-unknown-none-elf && \
cargo install cargo-binutils && \
rustup +nightly component add rust-src && \
rustup component add llvm-tools-preview && \
rustup component add clippy
RUN cargo install cargo-call-stack
RUN cargo install cargo-geiger
RUN cargo install hyperfine
RUN cargo install cargo-expand
RUN pip3 install pyfiglet pycryptodome