Skip to content

Commit 2c6d565

Browse files
jeremyederclaude
andauthored
docs: fix container Quick Start to use writable output volumes (#168)
Users were unable to access reports because examples used ephemeral container /tmp directory. Updated all examples to show proper pattern: - Mount writable host directory for output - Use mounted path for --output-dir - Reports now accessible on host filesystem Changes: - CONTAINER.md: Updated Quick Start, Usage, CI/CD examples - README.md: Updated Container (Recommended) section - Added troubleshooting section for ephemeral filesystem issue - Removed confusing "Save Output Files" section (integrated into examples) Fixes issue where `podman run --rm -v /repo:/repo:ro agentready assess /repo --output-dir /tmp` writes reports inside container's ephemeral /tmp, destroyed on exit. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent cba9cbb commit 2c6d565

File tree

4 files changed

+349
-22
lines changed

4 files changed

+349
-22
lines changed

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,76 @@ jobs:
8686
uses: pypa/gh-action-pypi-publish@release/v1
8787
with:
8888
attestations: true # Enable attestations for production
89+
90+
outputs:
91+
new_release: ${{ steps.check_release.outputs.new_release }}
92+
version: ${{ steps.check_release.outputs.version }}
93+
94+
build-container:
95+
name: Build and Push Container
96+
runs-on: ubuntu-latest
97+
needs: release
98+
if: needs.release.outputs.new_release == 'true'
99+
permissions:
100+
contents: read
101+
packages: write
102+
steps:
103+
- name: Checkout code
104+
uses: actions/checkout@v4
105+
with:
106+
ref: main
107+
108+
- name: Set up Docker Buildx
109+
uses: docker/setup-buildx-action@v3
110+
111+
- name: Log in to GitHub Container Registry
112+
uses: docker/login-action@v3
113+
with:
114+
registry: ghcr.io
115+
username: ${{ github.actor }}
116+
password: ${{ secrets.GITHUB_TOKEN }}
117+
118+
- name: Extract metadata
119+
id: meta
120+
uses: docker/metadata-action@v5
121+
with:
122+
images: ghcr.io/ambient-code/agentready
123+
tags: |
124+
type=semver,pattern={{version}},value=${{ needs.release.outputs.version }}
125+
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release.outputs.version }}
126+
type=semver,pattern={{major}},value=${{ needs.release.outputs.version }}
127+
type=raw,value=latest
128+
129+
- name: Build and push container
130+
uses: docker/build-push-action@v5
131+
with:
132+
context: .
133+
file: ./Containerfile.scratch
134+
push: true
135+
tags: ${{ steps.meta.outputs.tags }}
136+
labels: ${{ steps.meta.outputs.labels }}
137+
cache-from: type=gha
138+
cache-to: type=gha,mode=max
139+
platforms: linux/amd64,linux/arm64
140+
141+
- name: Container summary
142+
env:
143+
VERSION: ${{ needs.release.outputs.version }}
144+
REPOSITORY: ${{ github.repository }}
145+
run: |
146+
echo "## Container Published to GHCR" >> $GITHUB_STEP_SUMMARY
147+
echo "" >> $GITHUB_STEP_SUMMARY
148+
echo "📦 **Version**: $VERSION" >> $GITHUB_STEP_SUMMARY
149+
echo "🐳 **Registry**: ghcr.io/$REPOSITORY" >> $GITHUB_STEP_SUMMARY
150+
echo "" >> $GITHUB_STEP_SUMMARY
151+
echo "### Usage" >> $GITHUB_STEP_SUMMARY
152+
echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
153+
echo "# Pull latest" >> $GITHUB_STEP_SUMMARY
154+
echo "podman pull ghcr.io/$REPOSITORY:latest" >> $GITHUB_STEP_SUMMARY
155+
echo "" >> $GITHUB_STEP_SUMMARY
156+
echo "# Pull specific version" >> $GITHUB_STEP_SUMMARY
157+
echo "podman pull ghcr.io/$REPOSITORY:$VERSION" >> $GITHUB_STEP_SUMMARY
158+
echo "" >> $GITHUB_STEP_SUMMARY
159+
echo "# Run assessment" >> $GITHUB_STEP_SUMMARY
160+
echo "podman run --rm -v /path/to/repo:/repo:ro ghcr.io/$REPOSITORY:latest assess /repo --output-dir /tmp/out" >> $GITHUB_STEP_SUMMARY
161+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY

CONTAINER.md

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
# AgentReady Container
2+
3+
Size-optimized container (683 MB) for headless environments and CI/CD.
4+
5+
## Quick Start
6+
7+
```bash
8+
# Pull latest
9+
podman pull ghcr.io/ambient-code/agentready:latest
10+
11+
# Create output directory
12+
mkdir -p ~/agentready-reports
13+
14+
# Assess repository
15+
podman run --rm \
16+
-v /path/to/repo:/repo:ro \
17+
-v ~/agentready-reports:/reports \
18+
ghcr.io/ambient-code/agentready:latest \
19+
assess /repo --output-dir /reports
20+
21+
# Open reports
22+
open ~/agentready-reports/report-latest.html
23+
```
24+
25+
## Usage
26+
27+
### Assess AgentReady Itself
28+
29+
```bash
30+
# Clone AgentReady
31+
git clone https://github.com/ambient-code/agentready /tmp/agentready
32+
33+
# Create output directory
34+
mkdir -p ~/agentready-reports
35+
36+
# Run assessment
37+
podman run --rm \
38+
-v /tmp/agentready:/repo:ro \
39+
-v ~/agentready-reports:/reports \
40+
ghcr.io/ambient-code/agentready:latest \
41+
assess /repo --output-dir /reports
42+
43+
# Open reports
44+
open ~/agentready-reports/report-latest.html
45+
```
46+
47+
### Assess Your Repository
48+
49+
```bash
50+
# Create output directory
51+
mkdir -p ./agentready-reports
52+
53+
# Local repository
54+
podman run --rm \
55+
-v $(pwd):/repo:ro \
56+
-v $(pwd)/agentready-reports:/reports \
57+
ghcr.io/ambient-code/agentready:latest \
58+
assess /repo --output-dir /reports
59+
60+
# With additional options
61+
podman run --rm \
62+
-v $(pwd):/repo:ro \
63+
-v $(pwd)/agentready-reports:/reports \
64+
ghcr.io/ambient-code/agentready:latest \
65+
assess /repo --output-dir /reports --verbose
66+
67+
# Exclude specific assessors
68+
podman run --rm \
69+
-v $(pwd):/repo:ro \
70+
-v $(pwd)/agentready-reports:/reports \
71+
ghcr.io/ambient-code/agentready:latest \
72+
assess /repo --output-dir /reports -e type_annotations -e test_coverage
73+
```
74+
75+
### Save Output Files
76+
77+
```bash
78+
# Mount writable output directory
79+
podman run --rm \
80+
-v /path/to/repo:/repo:ro \
81+
-v $(pwd)/reports:/reports \
82+
ghcr.io/ambient-code/agentready:latest \
83+
assess /repo --output-dir /reports
84+
85+
# Reports saved: report-*.html, report-*.md, assessment-*.json
86+
```
87+
88+
## Available Tags
89+
90+
- `latest` - Latest stable release
91+
- `2.13.0` - Specific version
92+
- `2.13` - Major.minor version
93+
- `2` - Major version
94+
95+
```bash
96+
# Pin to specific version
97+
podman pull ghcr.io/ambient-code/agentready:2.13.0
98+
```
99+
100+
## Multi-Architecture Support
101+
102+
Supports both amd64 and arm64:
103+
104+
```bash
105+
# Automatically pulls correct architecture
106+
podman pull ghcr.io/ambient-code/agentready:latest
107+
```
108+
109+
## Docker Compatibility
110+
111+
Replace `podman` with `docker`:
112+
113+
```bash
114+
docker pull ghcr.io/ambient-code/agentready:latest
115+
docker run --rm \
116+
-v $(pwd):/repo:ro \
117+
-v $(pwd)/agentready-reports:/reports \
118+
ghcr.io/ambient-code/agentready:latest \
119+
assess /repo --output-dir /reports
120+
```
121+
122+
## CI/CD Integration
123+
124+
### GitHub Actions
125+
126+
```yaml
127+
- name: Run AgentReady Assessment
128+
run: |
129+
mkdir -p reports
130+
docker pull ghcr.io/ambient-code/agentready:latest
131+
docker run --rm \
132+
-v ${{ github.workspace }}:/repo:ro \
133+
-v ${{ github.workspace }}/reports:/reports \
134+
ghcr.io/ambient-code/agentready:latest \
135+
assess /repo --output-dir /reports
136+
137+
- name: Upload reports
138+
uses: actions/upload-artifact@v4
139+
with:
140+
name: agentready-reports
141+
path: reports/
142+
```
143+
144+
### GitLab CI
145+
146+
```yaml
147+
agentready:
148+
image: ghcr.io/ambient-code/agentready:latest
149+
script:
150+
- mkdir -p reports
151+
- agentready assess . --output-dir reports
152+
artifacts:
153+
paths:
154+
- reports/
155+
```
156+
157+
## Building Locally
158+
159+
```bash
160+
# Clone repository
161+
git clone https://github.com/ambient-code/agentready
162+
cd agentready
163+
164+
# Build container
165+
podman build -t agentready:local -f Containerfile.scratch .
166+
167+
# Test
168+
podman run --rm agentready:local --version
169+
```
170+
171+
## Technical Details
172+
173+
- **Base**: python:3.12-slim
174+
- **Size**: 683 MB
175+
- **User**: UID 1001 (non-root)
176+
- **Source**: PyPI (always latest agentready release)
177+
- **Output**: stdout/stderr (no volume mounts required)
178+
179+
## Troubleshooting
180+
181+
### Reports not accessible on host
182+
183+
Mount a writable output directory to save reports to your host filesystem:
184+
185+
```bash
186+
mkdir -p ~/agentready-reports
187+
podman run --rm \
188+
-v /repo:/repo:ro \
189+
-v ~/agentready-reports:/reports \
190+
ghcr.io/ambient-code/agentready:latest \
191+
assess /repo --output-dir /reports
192+
```
193+
194+
Without the `-v ~/agentready-reports:/reports` mount, reports written to `/tmp` inside the container are destroyed when the container exits.
195+
196+
### Permission denied on mounted volumes
197+
198+
Add SELinux context (`:Z` flag) on SELinux systems:
199+
200+
```bash
201+
podman run --rm \
202+
-v $(pwd):/repo:ro,Z \
203+
-v $(pwd)/agentready-reports:/reports,Z \
204+
ghcr.io/ambient-code/agentready:latest \
205+
assess /repo --output-dir /reports
206+
```
207+
208+
## Links
209+
210+
- **Container Registry**: https://github.com/ambient-code/agentready/pkgs/container/agentready
211+
- **Source Code**: https://github.com/ambient-code/agentready
212+
- **PyPI Package**: https://pypi.org/project/agentready/
213+
- **Documentation**: https://ambient-code.github.io/agentready/

Containerfile.scratch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# AgentReady - Size-Optimized Container
2+
# Self-contained, PyPI-based, stdout output
3+
#
4+
# Build: podman build -t agentready -f Containerfile.scratch .
5+
# Run: podman run --rm -v /path/to/repo:/repo:ro agentready assess /repo
6+
7+
FROM python:3.12-slim
8+
9+
LABEL name="agentready" \
10+
version="2.13.0" \
11+
description="Size-optimized AgentReady for headless environments" \
12+
maintainer="Jeremy Eder <[email protected]>"
13+
14+
# Install git (required by AgentReady's GitPython dependency)
15+
RUN apt-get update && \
16+
apt-get install -y --no-install-recommends git && \
17+
rm -rf /var/lib/apt/lists/*
18+
19+
# Install agentready from PyPI (latest stable release)
20+
RUN pip install --no-cache-dir agentready
21+
22+
# Create non-root user for security
23+
RUN useradd -u 1001 agentready
24+
25+
# Switch to non-root user
26+
USER 1001
27+
WORKDIR /tmp
28+
29+
# Direct agentready CLI execution
30+
ENTRYPOINT ["agentready"]
31+
CMD ["--help"]

README.md

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,45 @@ AgentReady evaluates your repository across multiple dimensions of code quality,
1919

2020
## Quick Start
2121

22-
### Bootstrap (Recommended)
23-
24-
Transform your repository with one command:
22+
### Container (Recommended)
2523

2624
```bash
27-
cd /path/to/your/repo
28-
agentready bootstrap .
29-
git add . && git commit -m "build: Bootstrap agent-ready infrastructure"
30-
git push
25+
# Pull container
26+
podman pull ghcr.io/ambient-code/agentready:latest
27+
28+
# Create output directory
29+
mkdir -p ~/agentready-reports
30+
31+
# Assess AgentReady itself
32+
git clone https://github.com/ambient-code/agentready /tmp/agentready
33+
podman run --rm \
34+
-v /tmp/agentready:/repo:ro \
35+
-v ~/agentready-reports:/reports \
36+
ghcr.io/ambient-code/agentready:latest \
37+
assess /repo --output-dir /reports
38+
39+
# Assess your repository
40+
podman run --rm \
41+
-v /path/to/your/repo:/repo:ro \
42+
-v ~/agentready-reports:/reports \
43+
ghcr.io/ambient-code/agentready:latest \
44+
assess /repo --output-dir /reports
45+
46+
# Open reports
47+
open ~/agentready-reports/report-latest.html
3148
```
3249

33-
**What you get:**
34-
35-
- ✅ GitHub Actions workflows (tests, security, AgentReady assessment)
36-
- ✅ Pre-commit hooks (formatters, linters)
37-
- ✅ Issue/PR templates
38-
- ✅ Dependabot configuration
39-
- ✅ Automated assessment on every PR
40-
41-
**Duration**: <60 seconds
50+
[See full container documentation →](CONTAINER.md)
4251

43-
[See detailed Bootstrap tutorial →](docs/user-guide.md#bootstrap-your-repository)
44-
45-
### Installation
52+
### Python Package
4653

4754
```bash
48-
# Clone the repository
49-
git clone https://github.com/yourusername/agentready.git
50-
cd agentready
55+
# Install
56+
pip install agentready
57+
58+
# Assess AgentReady itself
59+
git clone https://github.com/ambient-code/agentready /tmp/agentready
60+
agentready assess /tmp/agentready
5161

5262
# Create virtual environment
5363
python3 -m venv .venv

0 commit comments

Comments
 (0)