Skip to content

Commit fe7ae9a

Browse files
committed
Rune to run koji in a container
Adding runes to explain how one can run `koji` in a container. The feature to read a dockerfile from stdin is somewhat recent, but hopefully old enough for most people. The one-liner is just to be able to always run `koji`, without needed to prepare a container image before. These runes don't allow to load a specfile or other from the current directory. Signed-off-by: Anthony PERARD <[email protected]>
1 parent fb6ec8f commit fe7ae9a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/project/development-process/koji-initial-setup.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@ In some cases, we've found that the `cert` directive in `~/.koji/config ` was no
6262
## Test your connection
6363
`koji moshimoshi`. If it greats you (in any language), then your connection to the server works.
6464

65+
## Koji in Docker container
66+
67+
When your Linux distribution doesn't have a useable `koji`, you can always run it in a container.
68+
69+
Prepare an image:
70+
```
71+
docker build -t koji:latest - <<EOF
72+
FROM fedora:41
73+
RUN dnf install -qy koji
74+
EOF
75+
```
76+
77+
Then, to run koji with it, which will use the `~/.koji` directory that you've prepared outside the container:
78+
```
79+
docker run -it --rm -v$HOME/.koji:/root/.koji:ro koji:latest koji moshimoshi
80+
```
81+
82+
### Alternative as a one-liner
83+
84+
This command does the same as above, but rely on docker caching the result of a `docker build`:
85+
```
86+
docker run -it --rm -v$HOME/.koji:/root/.koji:ro $(docker build -q - <<<$'FROM fedora:41\nRUN dnf install -qy koji') koji moshimoshi
87+
```
88+
6589
## Useful commands
6690

6791
Just a quick list. Make sure to have read and understood our [development process tour](../../../category/development-process).

0 commit comments

Comments
 (0)