Skip to content

Added tutorial section on extending docker image#64

Merged
stffrdhrn merged 1 commit intoopenrisc:masterfrom
ash-olakangal:extend-docker-image
Mar 5, 2026
Merged

Added tutorial section on extending docker image#64
stffrdhrn merged 1 commit intoopenrisc:masterfrom
ash-olakangal:extend-docker-image

Conversation

@ash-olakangal
Copy link

@ash-olakangal ash-olakangal commented Mar 4, 2026

Description:
While following the OpenRISC tutorial, I noticed the Docker environment lacks a text editor by default. This addition provides steps to create a custom Dockerfile to include Vim.

I also encountered a few missing dependency errors while running hello world and compiling with gcc, so I also added these libraries in case the user also sees missing dependencies. (Separate issue tracked here: stffrdhrn/or1k-docker-images#2 (comment))

Changes:
Added a section on "Extending the docker image" to images.md.
Verified Markdown rendering and list numbering locally using jekyll and bundle.

Copy link
Member

@stffrdhrn stffrdhrn left a comment

Choose a reason for hiding this comment

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

Thanks for you patch, please find my comments.

images.md Outdated
$ vi hello.c
```

5. In case you see missing dependent libraries while going through this tutorial (especially while compiling with `gcc` if you see libmpc3, libmpfr6, libgmp10 libraries missing), you can add these to the Dockerfile and compile without errors:
Copy link
Member

Choose a reason for hiding this comment

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

Why would this be needed? If gcc is not working then there is a uig with the docker image we should fix. Do you have a case where this happens?

Copy link
Author

Choose a reason for hiding this comment

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

You're right, ideally, we should be fixing this in the image itself. I'll open a separate issue in the image.

In the meantime, let me know if I should remove this step or keep this while we fix the image.

FYI the details are:

The issue is seen when running the outlined steps for simulator environment, while running the hello world example.

amo@pop-os:~/Desktop/openRISC$ docker pull stffrdhrn/or1k-sim-env
Using default tag: latest
latest: Pulling from stffrdhrn/or1k-sim-env
Digest: sha256:fdc2c5c84804f6497fa8eccdf1b1de21684678076be330d1280f2cf10445f64b
Status: Image is up to date for stffrdhrn/or1k-sim-env:latest
docker.io/stffrdhrn/or1k-sim-env:latest

amo@pop-os:~/Desktop/openRISC$ docker run -it --rm stffrdhrn/or1k-sim-env
root@7696817a20cc:/tmp# cat <<EOF >hello.c
#include <stdio.h>

int main() {
    puts("Hello\n");
    return 0;
}
EOF

root@7696817a20cc:/tmp# ls
hello.c

root@7696817a20cc:/tmp# or1k-elf-gcc hello.c -o hello
/opt/or1k/or1k-elf/bin/../libexec/gcc/or1k-elf/15.1.0/cc1: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory

root@7696817a20cc:/tmp# or1k-elf-gcc --version
or1k-elf-gcc (GCC) 15.1.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Copy link
Member

@stffrdhrn stffrdhrn Mar 4, 2026

Choose a reason for hiding this comment

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

Definitely the original image needs to be fixed. We should remove this section from the docs and fix the original image. Do you want to do that?

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good. I'll take up the fix for docker image, and also update the PR to remove the 5th step in a while.

Copy link
Author

Choose a reason for hiding this comment

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

  1. Opened a new issue to track the fix needed in docker image. Taking up the task.

  2. Addressed the review comment to remove the 5th step with the latest commit.

If there's anything else, please let me know. If not then, I think we are good to push the changes. Also updated the main comment on the PR.

Copy link
Member

Choose a reason for hiding this comment

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

Can you squash this commit with the previous commit? We do not need the history of this to stay in the git tree.

Copy link
Author

Choose a reason for hiding this comment

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

Yep, Done!

@stffrdhrn stffrdhrn merged commit 840f061 into openrisc:master Mar 5, 2026
@stffrdhrn
Copy link
Member

Thank you

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.

2 participants