From 280b8b47c2b693560679fcb1661286f5751fcf0d Mon Sep 17 00:00:00 2001 From: ChinYikMing Date: Sat, 1 Mar 2025 21:34:47 +0800 Subject: [PATCH 1/2] 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. --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e61a8585b..6113086bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ FROM alpine:3.19 AS base_gcc -RUN apk add --update alpine-sdk git wget +RUN apk add --update alpine-sdk git wget sdl2-dev sdl2_mixer-dev # copy in the source code WORKDIR /home/root/rv32emu COPY . . # generate execution file for rv32emu and rv_histogram -RUN make ENABLE_SDL=0 +RUN make RUN make tool FROM alpine:3.19 AS final @@ -15,7 +15,9 @@ FROM alpine:3.19 AS final # copy in elf files COPY ./build/*.elf /home/root/rv32emu/build/ -# get rv32emu and rv_histogram binaries +# get rv32emu and rv_histogram binaries and lib of SDL2 and SDL2_mixer +COPY --from=base_gcc /usr/include/SDL2/ /usr/include/SDL2/ +COPY --from=base_gcc /usr/lib/libSDL2* /usr/lib/ COPY --from=base_gcc /home/root/rv32emu/build/rv32emu /home/root/rv32emu/build/rv32emu COPY --from=base_gcc /home/root/rv32emu/build/rv_histogram /home/root/rv32emu/build/rv_histogram From 37c9838131068871caf3ef4b6fa6bde2b1334a93 Mon Sep 17 00:00:00 2001 From: ChinYikMing Date: Sat, 1 Mar 2025 22:10:39 +0800 Subject: [PATCH 2/2] Bump Alpine Linux for Docker image End of support of Alpine Linux v3.19.x is on 1 Nov 2025. Check: https://alpinelinux.org/releases/ --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6113086bc..48ee4beab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.19 AS base_gcc +FROM alpine:3.21 AS base_gcc RUN apk add --update alpine-sdk git wget sdl2-dev sdl2_mixer-dev