-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathcheck-container-engine.sh
More file actions
executable file
·63 lines (53 loc) · 1.99 KB
/
check-container-engine.sh
File metadata and controls
executable file
·63 lines (53 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# Container Engine Detection and Validation Script
# This script helps users understand which container engine will be used
set -e
echo "🔍 Container Engine Detection Report"
echo "=================================="
# Check for Podman
if command -v podman >/dev/null 2>&1; then
echo "✅ Podman found: $(podman --version)"
PODMAN_AVAILABLE=true
else
echo "❌ Podman not found"
PODMAN_AVAILABLE=false
fi
# Check for Docker
if command -v docker >/dev/null 2>&1; then
echo "✅ Docker found: $(docker --version)"
DOCKER_AVAILABLE=true
else
echo "❌ Docker not found"
DOCKER_AVAILABLE=false
fi
echo ""
# Determine which engine would be used
if [ "$DOCKER_AVAILABLE" = true ] && [ "$PODMAN_AVAILABLE" = true ]; then
echo "🎯 Both container engines are available!"
echo " The Makefile will automatically use: Docker (default)"
echo " To use Podman instead: CONTAINER_ENGINE=podman make <target>"
elif [ "$PODMAN_AVAILABLE" = true ]; then
echo "🎯 Only Podman is available - it will be used automatically"
elif [ "$DOCKER_AVAILABLE" = true ]; then
echo "🎯 Only Docker is available - it will be used automatically"
else
echo "❌ No container engine found!"
echo " Please install either Docker or Podman to continue"
exit 1
fi
echo ""
echo "📋 Quick Commands:"
echo " Check current detection: make container-engine"
echo " Validate your engine: make validate-engine"
echo " Deploy with auto-detect: make local/deploy"
echo " Deploy with Docker: CONTAINER_ENGINE=docker make local/deploy"
echo " Deploy with Podman: CONTAINER_ENGINE=podman make local/deploy"
if [ "$PODMAN_AVAILABLE" = true ]; then
echo ""
echo "💡 Podman Tips:"
echo " - If you encounter permission issues, try:"
echo " ADDITIONAL_CONTAINER_ENGINE_PARAMS=\"--privileged\" make local/deploy"
echo " - For SELinux systems, volume mounts include :z labels automatically"
fi
echo ""
echo "✅ Environment check complete!"