Installing Docker via PowerShell with Chocolatey
Why Chocolatey
Chocolatey is a cloud-based package manager that lets you search for, install, update, and remove applications and tools through commands.
https://chocolatey.org/install
Installing Chocolatey
- Run PowerShell as an administrator and enter the following command:
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
P.S. If installation fails, try deleting the folder C:\ProgramData\chocolatey and running it again.
Installing applications and tools through Chocolatey
-
You can browse Chocolatey's available packages and install commands here:
https://community.chocolatey.org/packages -
Run PowerShell as an administrator and enter the following command:
choco install docker-desktop -y
Sample script
function Install-Chocolatey {
try {
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'));
}
catch {
$ErrorMessage = $_.Exception.Message;
$FailedItem = $_.Exception.ItemName;
Write-Host $ErrorMessage + $FailedItem;
return $false;
}
return $true;
}
Write-Host "Install chocolatey"
Install-Chocolatey;
Write-Host "Install Docker Software"
choco install docker-desktop -y
choco install docker-compose -y
choco install docker-kitematic -y





























Comments