harbor cache command group provides utilities for managing Harbor’s cache, including downloaded datasets, Docker images, and temporary files.
Commands
harbor cache clean
Clean Harbor cache by removing Docker images and the cache directory.Options
boolean
Skip confirmation prompt and clean immediately. Default:
falseboolean
Show what would be cleaned without actually cleaning. Default:
falseboolean
Skip Docker image cleanup. Default:
falseboolean
Skip cache directory cleanup. Default:
falseExamples
Clean cache with confirmation:What Gets Cleaned
Cache Directory
Location:~/.cache/harbor/
Contains:
- tasks/: Downloaded datasets and tasks
- jobs/: Job results (only if inside cache)
- registry/: Cached registry metadata
- environments/: Environment build caches
Docker Images
The command removes Docker images matching these patterns:alexgshaw/*- Harbor base imageshb__*- Harbor environment images (prefix: “harbor build”)sb__*- Sandbox environment images (prefix: “sandbox build”)
Usage Examples
Basic Cleanup
Clean everything with confirmation:Check Before Cleaning
Use dry run to see what would be removed:Automated Cleanup
Clean without prompts (useful for scripts):Selective Cleanup
Clean only Docker images (preserve downloaded tasks):When to Clean Cache
Free Up Disk Space
Docker images and cached tasks can consume significant storage:After Evaluations
Clean up after completing evaluations:Before Major Updates
Clean cache before updating Harbor:Development Workflow
Clean frequently during development:Advanced Usage
Preserve Specific Jobs
Move important job results before cleaning:Scheduled Cleanup
Automate cache cleanup with cron:Selective Docker Cleanup
Clean only old Docker images:Monitor Cache Size
Check cache size before and after:Troubleshooting
Docker Cleanup Fails
If Docker cleanup fails:Permission Issues
If cache directory cleanup fails:Partial Cleanup
If cleanup is interrupted:Best Practices
Regular Cleanup
Clean cache periodically:Before Long-Running Jobs
Clean cache to ensure enough disk space:Development Iterations
Clean frequently during development:CI/CD Integration
Clean cache in CI/CD pipelines:See Also
- harbor datasets - Download datasets
- harbor run - Run evaluations
- harbor jobs - Manage jobs