42 lines
1.4 KiB
Bash
42 lines
1.4 KiB
Bash
#!/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"
|