#!/bin/bash set -e echo "๐Ÿ—๏ธ Building enhanced Debian bootc base image..." # Create a temporary directory for the image (use /var/tmp instead of /tmp) TEMP_DIR=$(mktemp -d -p /var/tmp) echo "๐Ÿ“ Using temporary directory: $TEMP_DIR" # Copy the enhanced rootfs to the temp directory echo "๐Ÿ“ฆ Copying enhanced rootfs..." sudo cp -r /tmp/enhanced-rootfs/* "$TEMP_DIR/" # Copy the bootc configuration echo "โš™๏ธ Copying bootc configuration..." sudo cp debian-bootc-config.json "$TEMP_DIR/etc/" # Create a tar file from the rootfs echo "๐Ÿ“ฆ Creating tar archive..." cd "$TEMP_DIR" sudo tar -cf /var/tmp/enhanced-image.tar . cd - > /dev/null # Import the tar as a container image echo "๐Ÿณ Importing as container image..." sudo podman import /var/tmp/enhanced-image.tar localhost/debian-bootc:enhanced # Add labels using podman tag and inspect echo "๐Ÿท๏ธ Adding labels..." sudo podman tag localhost/debian-bootc:enhanced git.raines.xyz/particle-os/debian-bootc:enhanced # Push to remote registry echo "๐Ÿš€ Pushing to remote registry..." sudo podman push git.raines.xyz/particle-os/debian-bootc:enhanced # Clean up echo "๐Ÿงน Cleaning up..." sudo rm -rf "$TEMP_DIR" /var/tmp/enhanced-image.tar sudo podman rmi localhost/debian-bootc:enhanced echo "โœ… Enhanced Debian bootc base image built and pushed successfully!" echo "๐ŸŒ Image available at: git.raines.xyz/particle-os/debian-bootc:enhanced"