riotsecure/steps/step_docker.sh
cediackermann ef27add5d3 Refactor setup into modular steps; add split-device support
- Extract shared helpers into steps/common.sh (colors, print_*, wait_for_user, ask_confirmation)
- Split each install step into its own sourced script under steps/
- setup.sh now sources step files instead of duplicating logic
- Add setup_ollama.sh: Ollama-only device setup (no Docker)
- Add setup_onyx.sh: Onyx-only device setup with auto-detection of Ollama host via network scan
- setup_ollama.sh prints ready-to-run setup_onyx.sh command with detected IP at completion
- Docker memory recommendation is MAX when machine has <20 GB RAM, 20 GB otherwise
- cleanup.sh and check-status.sh source steps/common.sh with inline curl fallback
- check-status.sh detects device mode (single/ollama/onyx) and skips irrelevant checks
- cleanup.sh reinstall message lists all three setup one-liners
- README updated with split-device one-liner commands
2026-04-24 09:53:33 +02:00

50 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
# Step: Install and start Docker Desktop. Source common.sh before sourcing this file.
install_docker() {
print_step "Installing Docker Desktop"
if [ -d "/Applications/Docker.app" ]; then
print_success "Docker Desktop is already installed"
else
print_warning "Installing Docker Desktop via Homebrew..."
brew install --cask docker-desktop
print_success "Docker Desktop installed"
fi
print_warning "Opening Docker Desktop..."
if [ -d "/Applications/Docker.app" ]; then
open -a Docker
else
print_error "Docker.app not found in /Applications. Please install Docker Desktop manually."
exit 1
fi
echo ""
echo "MANUAL STEP REQUIRED:"
echo "1. Click through the Docker Desktop installer"
echo "2. Install any prompted software updates"
local TOTAL_MEM_GB
TOTAL_MEM_GB=$(sysctl -n hw.memsize | awk '{print int($1/1024/1024/1024)}')
local MEM_RECOMMENDATION
if [ "$TOTAL_MEM_GB" -ge 20 ]; then
MEM_RECOMMENDATION="20 GB"
else
MEM_RECOMMENDATION="MAX"
fi
echo "3. Go to Docker → Settings → Resources and set:"
echo " - CPU limit: MAX"
echo " - Memory limit: ${MEM_RECOMMENDATION}"
echo " - Disk usage limit: MAX"
echo "4. Click 'Apply & Restart'"
echo ""
wait_for_user
print_warning "Waiting for Docker to be ready..."
while ! docker info &> /dev/null; do
echo "Waiting for Docker daemon..."
sleep 5
done
print_success "Docker is ready"
}