Skip to content

Improve build cache and Docker container management#70

Open
Somnius wants to merge 1 commit intoomacom-io:mainfrom
Somnius:improve-build-cache-and-cleanup
Open

Improve build cache and Docker container management#70
Somnius wants to merge 1 commit intoomacom-io:mainfrom
Somnius:improve-build-cache-and-cleanup

Conversation

@Somnius
Copy link
Copy Markdown

@Somnius Somnius commented Jan 11, 2026

Summary

This PR improves the ISO build process with better package caching and Docker container management.

Changes

1. 24-Hour Package Cache Window

Problem: Arch packages update rapidly (multiple times per day). Daily cache can break builds mid-day when packages are updated.

Solution: Changed cache from daily to 24-hour window with hourly timestamps.

  • Cache format: iso_YYYYMMDD_HH (e.g., iso_20260111_14)
  • Cache location: ~/.cache/omarchy/iso_YYYYMMDD_HH/
  • Behavior: Cache is valid for 24 hours from first build in that hour
  • Benefits:
    • Prevents rapid package updates from breaking builds
    • Keeps packages reasonably fresh
    • Allows multiple builds within same hour to reuse cache

Example:

  • Build at 14:30 → Cache: iso_20260111_14 (reused until 14:00 next day)
  • Build at 15:00 → New cache: iso_20260111_15 (new hourly cache)
  • Build next day at 14:00 → New cache: iso_20260112_14 (24h window expired)

2. Docker Container Cleanup

Problem: Previous builds left containers running or stopped, causing conflicts and accumulation.

Solution: Use named containers with automatic cleanup.

  • Container name: omarchy-iso-build-$(id -u) (user-specific)
  • Safety: Only containers with exact name are touched - other containers are safe
  • Behavior:
    • Automatically removes previous build containers before starting
    • Cleans up container after build completes
    • Prevents container accumulation

Benefits:

  • No more container conflicts
  • Cleaner Docker environment
  • Safe for other containers (only touches specific named containers)

3. Convenience Script (Bonus)

Added omarchy-iso-make-local as a convenience wrapper for local development:

  • Pre-configured for building with local source
  • Sets OMARCHY_PATH automatically
  • Useful for developers working on installer changes

Files Changed

  • bin/omarchy-iso-make - Cache and container management improvements
  • bin/omarchy-iso-make-local - New convenience script (optional, can be removed if not needed)

Testing

  • ✅ Tested with multiple builds in same hour (cache reuse works)
  • ✅ Tested with builds across different hours (new cache created)
  • ✅ Tested container cleanup (no conflicts, safe cleanup)
  • ✅ Tested with --no-cache flag (still works)

Backward Compatibility

  • ✅ Fully backward compatible
  • --no-cache flag still works
  • ✅ All existing functionality preserved
  • ✅ No breaking changes

- Change package cache from daily to 24-hour window (hourly timestamps)
  * Prevents rapid Arch package updates from breaking ISO builds
  * Cache format: iso_YYYYMMDD_HH (e.g., iso_20260111_14)
  * Valid for 24 hours from first build in that hour

- Add Docker container cleanup with named containers
  * Use named containers: omarchy-iso-build-$(id -u) (user-specific)
  * Automatically clean up previous containers before build
  * Clean up container after build completes
  * Safe: only touches containers with exact name

- Add omarchy-iso-make-local convenience script
  * Wrapper for building with local source
  * Pre-configured environment variables
  * Useful for local development
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant