-
Notifications
You must be signed in to change notification settings - Fork 24
Description
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:
- Use a system with Podman installed and SELinux enabled.
- Ensure your host User ID is not 1001 (e.g., a corporate LDAP/SSSD account with a high UID).
- 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 - See errors:
- First:
Path '/repo' is not readable(SELinux) - Second:
SHA is empty, possible dubious ownership(Git security) - Third:
PermissionError: [Errno 13] Permission deniedwhen 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:
:z: Relabels the volume for SELinux.- **
--userns=keep-idand--user $(id -u):$(id -g)**: Aligns the container user with the host user to fixPermissionError. GIT_CONFIGenv vars: Tells the internal Git binary to trust the/repopath.
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