#!/bin/bash # Test Docker DNS connectivity echo "Testing Docker DNS connectivity..." echo "" # Test 1: Try to resolve registry echo "Test 1: DNS resolution from Docker container" docker run --rm --dns 8.8.8.8 alpine nslookup registry-1.docker.io 2>&1 | head -5 || echo "Failed" # Test 2: Try to pull with explicit DNS echo "" echo "Test 2: Pulling image with explicit DNS" docker run --rm --dns 8.8.8.8 --dns 8.8.4.4 alpine echo "DNS test container started" 2>&1 || echo "Failed" echo "" echo "If both tests fail, Docker Desktop DNS needs to be configured."