Skip to content

[BUG] Agent Ready Container mode execution instructions misses some key details #267

@kami619

Description

@kami619

Bug Description

The recommended container execution command fails on systems running Podman in rootless mode, particularly on Enterprise Linux distributions (Fedora, RHEL, CentOS) or systems with non-standard User IDs (UIDs). The issues stem from SELinux labeling, volume permission mismatches between host and container users, and Git's "dubious ownership" security check.

To Reproduce

Steps to reproduce the behavior:

  1. Use a system with Podman installed and SELinux enabled.
  2. Ensure your host User ID is not 1001 (e.g., a corporate LDAP/SSSD account with a high UID).
  3. Run the recommended command:
    podman run --rm -it -v $(pwd):/repo:ro -v $(pwd)/reports:/reports ghcr.io/ambient-code/agentready:latest assess /repo --output-dir /reports
  4. See errors:
  • First: Path '/repo' is not readable (SELinux)
  • Second: SHA is empty, possible dubious ownership (Git security)
  • Third: PermissionError: [Errno 13] Permission denied when writing to /reports (UID mismatch)

Expected Behavior

The container should be able to read the mounted repository, verify the Git state, and write the output JSON/HTML reports to the mounted volume without manual UID remapping or permission changes on the host.

Actual Behavior

The process fails at multiple stages due to host-container isolation boundaries. The container's internal user (agentready:1001) cannot interact with host files owned by the user (e.g., 123123123).

Environment

  • OS: Fedora / RHEL (Podman environment)
  • Version: latest
  • Python Version: 3.12 (inside container)

Additional Context

In rootless Podman, the internal user 1001 does not automatically have permission to write to host volumes unless the UIDs are aligned or the volumes are relabeled. Furthermore, Git 2.35.2+ prevents operations on repositories where the current user doesn't match the owner of the .git folder.

Possible Solution

The documentation should be updated to include a "Podman/Rootless" version of the command. The following flags resolve the issues:

  1. :z: Relabels the volume for SELinux.
  2. **--userns=keep-id and --user $(id -u):$(id -g)**: Aligns the container user with the host user to fix PermissionError.
  3. GIT_CONFIG env vars: Tells the internal Git binary to trust the /repo path.

Proposed updated command for Podman users:

podman run --rm -it \
  --user $(id -u):$(id -g) \
  --userns=keep-id \
  -e GIT_CONFIG_COUNT=1 \
  -e GIT_CONFIG_KEY_0=safe.directory \
  -e GIT_CONFIG_VALUE_0=/repo \
  -v /path/to/repo:/repo:ro,z \
  -v /path/to/reports:/reports:z \
  ghcr.io/ambient-code/agentready:latest assess /repo --output-dir /reports

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions