Skip to content

Commit d7ad9a5

Browse files
committed
Fix Docker image build
Commit a40fd0b adds objects file that built with the lib of SDL2 and SDL2_mixer for linker when building rv_histogram, the current Docker image lacks of SDL2 and SDL2_mixer shared objects, so installing them to fix the missing shared objects. The final Docker image size changes from around 4 MiB -> 28 MiB.
1 parent dc5a56f commit d7ad9a5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
FROM alpine:3.19 AS base_gcc
22

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

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

9+
910
# generate execution file for rv32emu and rv_histogram
10-
RUN make ENABLE_SDL=0
11+
RUN make
1112
RUN make tool
1213

1314
FROM alpine:3.19 AS final
1415

1516
# copy in elf files
1617
COPY ./build/*.elf /home/root/rv32emu/build/
1718

18-
# get rv32emu and rv_histogram binaries
19+
# get rv32emu and rv_histogram binaries and lib of SDL2 and SDL2_mixer
20+
COPY --from=base_gcc /usr/include/SDL2/ /usr/include/
21+
COPY --from=base_gcc /usr/lib/libSDL2* /usr/lib/
1922
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu
2023
COPY --from=base_gcc /home/root/rv32emu/build/rv_histogram /home/root/rv32emu/build/rv_histogram
2124

0 commit comments

Comments
 (0)