23 lines
1.4 KiB
Batchfile
23 lines
1.4 KiB
Batchfile
@echo off
|
|
echo Adding official Docker repository...
|
|
wsl -d Ubuntu-22.04 bash -c "sudo apt-get update && sudo apt-get install -y ca-certificates curl gnupg lsb-release"
|
|
wsl -d Ubuntu-22.04 bash -c "sudo install -m 0755 -d /etc/apt/keyrings"
|
|
wsl -d Ubuntu-22.04 bash -c "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg"
|
|
wsl -d Ubuntu-22.04 bash -c "echo 'deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable' | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null"
|
|
|
|
echo Installing Docker Engine 28.3.2 + Docker Compose V2...
|
|
wsl -d Ubuntu-22.04 bash -c "sudo apt-get update && sudo apt-get install -y docker-ce=5:28.3.2-1~ubuntu.22.04~jammy docker-ce-cli=5:28.3.2-1~ubuntu.22.04~jammy containerd.io docker-compose-plugin"
|
|
|
|
echo Holding Docker packages to prevent auto-upgrade...
|
|
wsl -d Ubuntu-22.04 bash -c "sudo apt-mark hold docker-ce docker-ce-cli containerd.io"
|
|
|
|
echo Enabling Docker daemon...
|
|
wsl -d Ubuntu-22.04 bash -c "sudo systemctl enable docker && sudo systemctl start docker"
|
|
|
|
echo ============================================
|
|
echo Setup complete! Checking versions...
|
|
wsl -d Ubuntu-22.04 bash -c "docker --version"
|
|
wsl -d Ubuntu-22.04 bash -c "docker compose version"
|
|
echo ============================================
|
|
pause
|