Skip to content

Commit c41e311

Browse files
committed
Enhance Docker image with rv32emu-user, rv32emu-system, and rv32emu-histogram
Include three executables in the Docker image: - rv32emu-user: for user-mode emulation - rv32emu-system: for system-mode emulation - rv32emu-histogram: for statistical analysis This enhancement enables the Docker image to support both user-mode and system-mode emulation. Close #581
1 parent eb36e7f commit c41e311

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
FROM alpine:3.21 AS base_gcc
22

3-
RUN apk add --update alpine-sdk git wget sdl2-dev sdl2_mixer-dev
3+
RUN apk add --update alpine-sdk git wget sdl2-dev sdl2_mixer-dev dtc
44

55
# copy in the source code
66
WORKDIR /home/root/rv32emu
77
COPY . .
88

99
# generate execution file for rv32emu and rv_histogram
10-
RUN make
11-
RUN make tool
10+
RUN make -j"$(nproc)"
11+
RUN make tool -j"$(nproc)"
12+
RUN mv ./build/rv32emu ./build/rv32emu-user
13+
RUN mv ./build/rv_histogram ./build/rv32emu-histogram
14+
RUN make distclean
15+
RUN make ENABLE_SYSTEM=1 INITRD_SIZE=32 -j"$(nproc)"
1216

1317
FROM alpine:3.21 AS final
1418

@@ -18,8 +22,9 @@ COPY ./build/*.elf /home/root/rv32emu/build/
1822
# get rv32emu and rv_histogram binaries and lib of SDL2 and SDL2_mixer
1923
COPY --from=base_gcc /usr/include/SDL2/ /usr/include/SDL2/
2024
COPY --from=base_gcc /usr/lib/libSDL2* /usr/lib/
21-
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu
22-
COPY --from=base_gcc /home/root/rv32emu/build/rv_histogram /home/root/rv32emu/build/rv_histogram
25+
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu-user /home/root/rv32emu/build/rv32emu-user
26+
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu-system
27+
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu-histogram /home/root/rv32emu/build/rv32emu-histogram
2328

2429
ENV PATH=/home/root/rv32emu/build:$PATH
2530

0 commit comments

Comments
 (0)