Skip to content

Conversation

kaiii708
Copy link
Contributor

This commit updates the Docker image to include the following executables:

  • rv32emu-user: for user-mode emulation
  • rv32emu-system: for system-mode emulation
  • rv_histogram: for statistical analysis

To keep the image compact, build artifacts are excluded from the final image. Instructions for retrieving prebuilt binaries are added to the README.

Close #581


FROM alpine:3.19 AS final
FROM alpine:3.21 AS final
Copy link
Collaborator

Choose a reason for hiding this comment

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

Which parts of this change rely on Alpine 3.21 and wouldn't work on 3.19?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Commit 37c9838 mentioned that the end of support for Alpine Linux v3.19.x is on 1 Nov 2025, so I upgraded it to 3.21.

@visitorckw
Copy link
Collaborator

This patch updates the Dockerfile but also makes large README changes.
I’d prefer splitting them into separate commits so each does one thing and review is easier.

@visitorckw
Copy link
Collaborator

Also, I'd prefer using the imperative mood when describing changes [1].
E.g. This commit updates ... -> Update ...

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.17-rc3#n94 [1]

Commit 37c9838 ("Bump Alpine Linux for Docker image") updated
only the build stage but left the final stage unchanged. This commit
completes the version bump by upgrading the final stage as well.
@kaiii708
Copy link
Contributor Author

kaiii708 commented Sep 1, 2025

Split into 3 commits. Please take another look. Thanks!

@kaiii708
Copy link
Contributor Author

kaiii708 commented Sep 2, 2025

The CI build has succeeded, and the Docker image is available here:
https://github.com/kaiii708/rv32emu/actions/runs/17394344573
Test it with:

docker run --rm -it kaiii708/rv32emu

Dockerfile Outdated
@@ -9,17 +9,22 @@ COPY . .
# generate execution file for rv32emu and rv_histogram
RUN make
RUN make tool
RUN mv ./build/rv32emu ./build/rv32emu-user
RUN mv ./build/rv_histogram ./build/tmp_rv_histogram
Copy link
Collaborator

Choose a reason for hiding this comment

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

Renaming rv_histogram to tmp_rv_histogram and then back looks a bit hacky and may confuse readers.
Since we already renamed rv32emu to rv32emu-user/rv32emu-system, how about also giving rv_histogram an rv32emu- prefix?
That way all three binaries can be renamed to their final names right after build, and the later COPY steps become cleaner and easier to follow.

-k rv32emu-linux-image-prebuilt/linux-image/Image \
-i rv32emu-linux-image-prebuilt/linux-image/rootfs.cpio
```

Copy link
Collaborator

Choose a reason for hiding this comment

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

Since we renamed rv_histogram, could we also update the README's Docker section to document how to run the histogram tool in addition to the user/system mode emulators?

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 sysprog21#581
Document how to fetch and run user-mode and system-mode artifacts
from the rv32emu-prebuilt repository when using the Docker image.

Link: https://github.com/sysprog21/rv32emu-prebuilt
@jserv jserv merged commit b85c6c1 into sysprog21:master Sep 5, 2025
81 of 91 checks passed
@jserv
Copy link
Contributor

jserv commented Sep 5, 2025

Thank @kaiii708 for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancing the Docker Image
3 participants