Skip to content
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
36 changes: 35 additions & 1 deletion images.md
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!

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ in these docker images.

As the images have no editor installed by default you can create a simple
program using `cat` as below. If needed you can install an editor with `apt-get`
or by extending the docker image.
or [by extending the docker image](#extending-the-docker-image).

Create a `hello.c`

Expand Down Expand Up @@ -226,6 +226,40 @@ Hello
src/mor1kx_5.2/bench/verilog/mor1kx_monitor.v:140: $finish called at 171635 (1s)
```

## Extending the docker image

To add vim or other terminal based text editors while running docker you can extend the docker image with the following steps:

1. Create a file named `Dockerfile` where you're planning to run OpenRISC image from (ensure you're not running the docker image):

```bash
touch Dockerfile
```

2. Add the following to the `Dockerfile` and save it:

```bash
FROM stffrdhrn/or1k-sim-env

# Install the terminal-based Vim
RUN apt-get update && apt-get install -y \
vim \
&& rm -rf /var/lib/apt/lists/*
```

3. Build and run:

```bash
docker build -t openrisc-vim .
docker run -it openrisc-vim /bin/bash
```

4. You should now be able to open and edit files using vim every time you run the above command:

```bash
$ vi hello.c
```

## Further Reading

- [stffrdhrn/or1k-docker-images](https://github.com/stffrdhrn/or1k-docker-images) - OpenRISC docker images home page