|
1 |
| -FROM sysprog21/rv32emu-sail as base_sail |
| 1 | +FROM alpine:3.19 as base_gcc |
2 | 2 |
|
3 |
| -FROM ubuntu:22.04 as base_gcc |
4 |
| - |
5 |
| -# install extra packages for the emulator to compile with full capabilities correctly |
6 |
| -RUN apt-get update && \ |
7 |
| - DEBIAN_FRONTEND=noninteractive apt-get install -y \ |
8 |
| - build-essential curl git && \ |
9 |
| - rm -rf /var/lib/apt/lists/* |
| 3 | +RUN apk add --update alpine-sdk git curl |
10 | 4 |
|
11 | 5 | # copy in the source code
|
12 | 6 | WORKDIR /home/root/rv32emu
|
13 | 7 | COPY . .
|
14 | 8 |
|
15 | 9 | # generate execution file for rv32emu and rv_histogram
|
16 |
| -RUN make |
| 10 | +RUN make ENABLE_SDL=0 |
17 | 11 | RUN make tool
|
18 | 12 |
|
19 |
| -FROM ubuntu:22.04 as final |
20 |
| - |
21 |
| -# set up the timezone |
22 |
| -ENV TZ=Asia/Taipei |
23 |
| -RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
| 13 | +FROM alpine:3.19 as final |
24 | 14 |
|
25 |
| -# copy in elf files and reference emulator |
26 |
| -WORKDIR /home/root/rv32emu |
| 15 | +# copy in elf files |
27 | 16 | COPY ./build/*.elf /home/root/rv32emu/build/
|
28 |
| -COPY ./tests/arch-test-target/sail_cSim/riscv_sim_RV32 /home/root/rv32emu/tests/arch-test-target/sail_cSim/ |
29 |
| - |
30 |
| -# replace the emulator (riscv_sim_RV32) with the arch that the container can execute |
31 |
| -RUN rm /home/root/rv32emu/tests/arch-test-target/sail_cSim/riscv_sim_RV32 |
32 |
| -COPY --from=base_sail /home/root/riscv_sim_RV32 /home/root/rv32emu/tests/arch-test-target/sail_cSim/ |
33 | 17 |
|
34 | 18 | # get rv32emu and rv_histogram binaries
|
35 | 19 | COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu
|
36 | 20 | COPY --from=base_gcc /home/root/rv32emu/build/rv_histogram /home/root/rv32emu/build/rv_histogram
|
37 | 21 |
|
38 |
| -ENV PATH=/home/root/rv32emu/build:/home/root/rv32emu/tests/arch-test-target/sail_cSim:$PATH |
| 22 | +ENV PATH=/home/root/rv32emu/build:$PATH |
| 23 | + |
| 24 | +WORKDIR /home/root/rv32emu |
0 commit comments