tool-containers
Menu
GitHub (opens in new tab)

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
  • GHCRghcr.io/hambn/open-code-review
  • Docker Hubdocker.io/hambn/open-code-review
Use case
Rootless reviews on a workstation
Upstream
github.com/alibaba/open-code-review (opens in new tab)
Source
tools/ai/open-code-review/docs/podman (opens in new tab)
On this page

Prerequisites

  • Rootless Podman 4.3 or later, for --userns=keep-id:uid=1000,gid=1000.
  • An API key for an LLM provider ocr supports, such as ANTHROPIC_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-browser

Then configure and review inside it:

Shell
ocr config set provider anthropic
ocr config set model <model>
ocr review

Variables

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.sh runs 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" "$@"

Topics