4.2 KiB
🐛 Docker Image Pull Issue - Fixed
Problem Identified
The deployment was failing on new machines because:
- ❌ No image published - The Docker image
aiulian25/soundwave:latestwas never pushed to Docker Hub - ❌ No CI/CD pipeline - No automated builds to GitHub Container Registry
- ❌ No fallback option - Users couldn't build locally if pull failed
Solutions Implemented
1. GitHub Actions Workflow (Automated)
Created .github/workflows/docker-publish.yml:
- ✅ Automatically builds Docker image on push to main/master
- ✅ Publishes to GitHub Container Registry (ghcr.io)
- ✅ Supports multi-platform (amd64, arm64)
- ✅ Creates versioned tags for releases
- ✅ Uses GitHub Actions cache for faster builds
2. Updated docker-compose.yml
Changed image source from Docker Hub to GitHub Container Registry:
image: ghcr.io/aiulian25/soundwave:latest
Added commented build option as fallback:
# build:
# context: .
# dockerfile: Dockerfile
🚀 How to Use
For End Users (After First Push)
Option 1: Pull Pre-built Image (Recommended)
# Clone repository
git clone https://github.com/aiulian25/soundwave.git
cd soundwave
# Start services (will pull from ghcr.io)
docker compose up -d
Option 2: Build Locally (If pull fails or for development)
# Clone repository
git clone https://github.com/aiulian25/soundwave.git
cd soundwave
# Build frontend first
cd frontend
npm install
npm run build
cd ..
# Build and start with Docker
docker compose up -d --build
For Repository Owner (First Time Setup)
- Push to GitHub - Push this repository to GitHub
- Enable Package Publishing:
- Go to repository Settings → Actions → General
- Under "Workflow permissions", select "Read and write permissions"
- Check "Allow GitHub Actions to create and approve pull requests"
- Trigger First Build:
- Push to main branch, or
- Go to Actions → "Build and Publish Docker Image" → Run workflow
The image will be published to: ghcr.io/yourusername/soundwave:latest
Making the Image Public
By default, GitHub Container Registry images are private. To make it public:
- Go to your GitHub profile → Packages
- Click on
soundwavepackage - Click "Package settings"
- Scroll to "Danger Zone"
- Click "Change visibility" → "Public"
📝 Deployment Files Updated
- ✅
.github/workflows/docker-publish.yml- CI/CD pipeline - ✅
docker-compose.yml- Updated image reference - ✅ This troubleshooting guide
🔄 Updating the Image
After pushing code changes:
- GitHub Actions automatically builds new image
- Users pull latest with:
docker compose pull && docker compose up -d
🛠️ Alternative: Docker Hub
If you prefer Docker Hub over GitHub Container Registry:
-
Login to Docker Hub:
docker login -
Build and push:
cd frontend && npm install && npm run build && cd .. docker build -t aiulian25/soundwave:latest . docker push aiulian25/soundwave:latest -
Update docker-compose.yml:
image: aiulian25/soundwave:latest -
Add to GitHub Secrets (for automation):
- Repository Settings → Secrets → Actions
- Add
DOCKERHUB_USERNAMEandDOCKERHUB_TOKEN - Update workflow to use Docker Hub
📋 Quick Reference
Current Image Location: ghcr.io/aiulian25/soundwave:latest
Build Context: Root directory (includes frontend/dist)
Platforms Supported: linux/amd64, linux/arm64
Auto-build: On push to main/master branch
✅ Verification
After setup, verify the image is available:
# Check if image exists (after first GitHub Actions run)
docker pull ghcr.io/aiulian25/soundwave:latest
# Or check GitHub Packages
# Visit: https://github.com/yourusername?tab=packages
🎯 Benefits
- Zero-config for users - Just
docker compose up -d - Automatic updates - CI/CD builds on every push
- Multi-platform - Works on Intel and ARM (Apple Silicon, Raspberry Pi)
- Version tags - Can pin to specific versions
- Fallback option - Can build locally if needed