Prompt file imported from rhixecompany/sandbox (
.github/prompts/ci-cd/all-repo-docker-setup/all-repo-docker-setup.prompt.md). Copyright stays with the author.
Table of Contents
Goal
Iterate over a list of rhixecompany repositories, generate or repair Dockerfiles, build images, run security scans, and clean up unused Docker resources with a tracked plan.
Context
Phases
Bulk Docker Setup Across Repositories
Iterate over every rhixecompany repository, generate or repair Dockerfiles, build images, security-scan them, and clean up unused Docker resources.
Systematically process all repositories under rhixecompany to ensure each has a valid Dockerfile or docker-compose.yml, builds successfully, passes security scanning, and has a documented cleanup plan. Unused Docker resources are reclaimed with a tracked report.
Prerequisites
ghCLI authenticated and able to listrhixecompanyrepos- Docker daemon running and accessible
trivyinstalled for security scanningdockerCLI withdocker composeplugin- Write access to
~/Desktop/SandBox/projects/
Inputs
- The list of repositories from
gh repo list rhixecompany --limit 100 --json name,url - Existing Docker artifacts in each repo (Dockerfile, docker-compose.yml)
- Docker images built during the process
Outputs
- A valid Dockerfile or
docker-compose.ymlin each repository (created or repaired) - All images built successfully
- Security scan report per repository (Trivy output)
- A cleanup report listing freed disk space
Steps
1. List repositories
- List all rhixecompany repositories:
gh repo list rhixecompany --limit 100 --json name,url - Clone each repository to
~/Desktop/SandBox/projects/:git clone <repository_url> ./projects/<repository_name>
2. Generate or repair Docker configuration
For each repository:
- Check for existing
Dockerfileordocker-compose.yml - If no Docker configuration exists, generate one based on the project's language (Node.js, Python, Go, Rust, etc.)
- If a Dockerfile exists but is broken, debug, fix, and update it to a smaller base image
- Build the image to verify it works:
docker build -t <image_name> . - If only
docker-compose.ymlexists, build with:docker-compose build
3. Security scan
Run Trivy scan on each built image:
trivy image --severity HIGH,CRITICAL <image_name>
Record findings and fix critical vulnerabilities by updating base images or dependencies.
4. Cleanup
- Remove unused containers:
docker container prune -f - Remove unused images:
docker image prune -a -f - Remove unused volumes:
docker volume prune -f - Remove build caches:
docker buildx builder prune -f - Report freed space:
docker system df
Rules
- Scope discipline — Only operate on rhixecompany repositories
- Minimal changes — Fix the smallest issue needed to build successfully
- Track everything — Log results to
docker_setup.login each repo root - No Docker config found — Log "No Docker configuration found for this repository" to
docker_setup.logif neither file exists
Verification
- Each repository has either a
Dockerfileordocker-compose.yml - All images build without errors
- No HIGH/CRITICAL vulnerabilities remain (or documented rationale for exceptions)
- Cleanup report is saved
Out of Scope
Workflow
- Modifying application code beyond Docker-related config
- Production deployment orchestration