Run Open Code Review with Podman
run.sh starts Open Code Review under rootless Podman on
the current directory, passing any arguments to ocr.
- Images
- GHCR
ghcr.io/hambn/open-code-review - Docker Hub
docker.io/hambn/open-code-review
- GHCR
- Use case
- Rootless reviews on a workstation
Prerequisites
- Rootless Podman 4.3 or later, for
--userns=keep-id:uid=1000,gid=1000. - An API key for an LLM provider
ocrsupports, such asANTHROPIC_API_KEY.
Review your changes
run.sh passes no environment, and the provider settings ocr saves in the container
are removed with it. Start a shell with your key instead:
Shell
podman run -it --rm --userns=keep-id:uid=1000,gid=1000 -e ANTHROPIC_API_KEY \
-v "$PWD:/workspace:Z" --entrypoint zsh ghcr.io/hambn/open-code-review:ubuntu-browserThen configure and review inside it:
Shell
ocr config set provider anthropic
ocr config set model <model>
ocr reviewVariables
| Variable | Required | Purpose |
|---|---|---|
OPEN_CODE_REVIEW_IMAGE |
no | Image run.sh runs. Defaults to ghcr.io/hambn/open-code-review:ubuntu-browser; set a digest reference to pin one build. |
Workspace
The current directory is mounted at /workspace with :Z, so SELinux hosts relabel it
for the container. --userns=keep-id maps your host user to sysadmin (UID 1000), so
files the container writes stay owned by you.
Files
run.shruns the published image with rootless Podman.
File contents
run.sh8 lines
#!/usr/bin/env bash
# Run Open Code Review rootlessly against the current directory; :Z relabels it on SELinux hosts.
set -euo pipefail
image=${OPEN_CODE_REVIEW_IMAGE:-ghcr.io/hambn/open-code-review:ubuntu-browser}
podman run -it --rm --userns=keep-id:uid=1000,gid=1000 \
-v "$PWD:/workspace:Z" \
"$image" "$@"