feat(containers): optimize Linux buildx configuration for better caching

Enhanced the Linux container build workflow with optimal buildx settings
for improved caching performance and build reliability:

Changes:
- Configure buildx with docker-container driver for better isolation
- Add network=host driver option for improved connectivity
- Enable security and network entitlements for complex builds
- Add GitHub Actions cache integration (cache-from/cache-to type=gha)
- Set cache mode to 'max' for maximum layer caching
- Use type=docker output for better compatibility

Benefits:
- Faster builds through GitHub Actions cache integration
- Better layer caching with mode=max setting
- Improved build reliability with proper entitlements
- Reduced build times for subsequent runs
- Better handling of complex multi-step builds like TeX Live

This keeps buildx (which is optimal for Linux) while fixing the
configuration issues that were causing build problems.
This commit is contained in:
Vijay Janapa Reddi
2025-08-17 16:04:22 -04:00
parent af7fcc3776
commit 1ea046865b

View File

@@ -149,6 +149,11 @@ jobs:
- name: 🐳 Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: |
network=host
buildkitd-flags: --allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host
- name: 🔐 Log in to Container Registry
id: login
@@ -239,6 +244,9 @@ jobs:
platforms: ${{ env.PLATFORM }}
provenance: false # Disable provenance for better compatibility
sbom: false # Disable SBOM for better compatibility
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker
- name: Build Complete
run: |