Add Git installation check to Docker installation script
This commit is contained in:
@@ -9,9 +9,22 @@ is_wsl() {
|
|||||||
grep -qi microsoft /proc/version 2>/dev/null
|
grep -qi microsoft /proc/version 2>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_git_installed() {
|
||||||
|
if ! command -v git &> /dev/null; then
|
||||||
|
echo "🔍 Git not found, installing..."
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y git
|
||||||
|
echo "✅ Git installed successfully!"
|
||||||
|
else
|
||||||
|
echo "✔️ Git is already installed: $(git --version)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
install_docker_linux() {
|
install_docker_linux() {
|
||||||
echo "🔧 Installing Docker on Linux..."
|
echo "🔧 Installing Docker on Linux..."
|
||||||
|
|
||||||
|
check_git_installed
|
||||||
|
|
||||||
# Remove old versions
|
# Remove old versions
|
||||||
sudo apt-get remove -y docker docker-engine docker.io containerd runc || true
|
sudo apt-get remove -y docker docker-engine docker.io containerd runc || true
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user