refactor: restructure registry with auth and agent guidelines
- Add built-in authentication with Apache utils - Add AGENTS.md for coding guidelines - Enhance security with authentication enabled by default - Remove unnecessary template files - Simplify configuration and setup process
This commit is contained in:
41
setup.sh
41
setup.sh
@@ -1,33 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Setup script for Lightweight Docker Registry
|
||||
echo "Setting up Docker Registry with authentication..."
|
||||
|
||||
echo "🐳 Setting up Lightweight Docker Registry..."
|
||||
# Build and start the registry
|
||||
docker-compose up -d --build
|
||||
|
||||
# Create necessary directories
|
||||
mkdir -p data auth certs
|
||||
echo "Waiting for registry to start..."
|
||||
sleep 5
|
||||
|
||||
# Copy environment file if it doesn't exist
|
||||
if [ ! -f .env ]; then
|
||||
cp .env.example .env
|
||||
echo "✅ Created .env file from template"
|
||||
else
|
||||
echo "ℹ️ .env file already exists"
|
||||
fi
|
||||
|
||||
# Set proper permissions
|
||||
chmod 755 data auth certs
|
||||
|
||||
echo "🚀 Starting registry..."
|
||||
docker-compose up -d
|
||||
# Set initial password for recruas user
|
||||
echo "Setting password for 'recruas' user..."
|
||||
docker exec -it registry htpasswd -B /etc/docker/registry/auth/htpasswd recruas
|
||||
|
||||
echo "Setup complete!"
|
||||
echo "Registry is running with authentication enabled."
|
||||
echo "Default user: recruas"
|
||||
echo "UI will be available on port 80 (exposed)"
|
||||
echo "Registry API available on port 5000 (exposed)"
|
||||
echo ""
|
||||
echo "✅ Registry is running!"
|
||||
echo "📊 Web UI: http://your-domain"
|
||||
echo "🔌 Registry API: http://your-domain:5000"
|
||||
echo ""
|
||||
echo "💡 To push an image:"
|
||||
echo " docker tag myimage your-domain:5000/myimage"
|
||||
echo " docker push your-domain:5000/myimage"
|
||||
echo ""
|
||||
echo "📝 Edit .env file to customize configuration"
|
||||
echo "To change password later:"
|
||||
echo "docker exec -it registry htpasswd -B /etc/docker/registry/auth/htpasswd recruas"
|
||||
Reference in New Issue
Block a user