Skip to content

Commit 280b8b4

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 59fb73f commit 280b8b4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
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

99
# generate execution file for rv32emu and rv_histogram
10-
RUN make ENABLE_SDL=0
10+
RUN make
1111
RUN make tool
1212

1313
FROM alpine:3.19 AS final
1414

1515
# copy in elf files
1616
COPY ./build/*.elf /home/root/rv32emu/build/
1717

18-
# get rv32emu and rv_histogram binaries
18+
# get rv32emu and rv_histogram binaries and lib of SDL2 and SDL2_mixer
19+
COPY --from=base_gcc /usr/include/SDL2/ /usr/include/SDL2/
20+
COPY --from=base_gcc /usr/lib/libSDL2* /usr/lib/
1921
COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu
2022
COPY --from=base_gcc /home/root/rv32emu/build/rv_histogram /home/root/rv32emu/build/rv_histogram
2123

0 commit comments

Comments
 (0)