Skip to content

Fix Docker image build #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
FROM alpine:3.19 AS base_gcc
FROM alpine:3.21 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 link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The primary reason for excluding SDL2 packages from the current Alpine Linux image is to maintain a smaller image size, which enables quicker startup and emulation through blink or similar emulators. Including SDL2 in the Alpine Linux image would create challenges when attempting to run graphics with the emulator.

# 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

# 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

Expand Down
Loading