Skip to content

Commit

Permalink
imp: uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
abdotaskies committed Sep 5, 2024
1 parent 23a18e9 commit 3df757e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docker.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# sudo pwsh -Command "iex '& ([scriptblock]::Create((iwr https://raw.githubusercontent.com/abdullahfarook/kube/main/docker.ps1)))'"
param(
[bool]$uninstall = $false
)
function Write-Log {
param (
[string]$message,
Expand All @@ -22,6 +25,19 @@ function Write-Err {
Write-Log $message "ERR"
exit 1
}
if ($uninstall -eq $true) {
Write-Log "Uninstalling docker..."
apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli docker-compose-plugin
apt-get autoremove -y --purge docker-engine docker docker.io docker-ce docker-compose-plugin
rm -rf /var/lib/docker /etc/docker
rm /etc/apparmor.d/docker
groupdel docker
rm -rf /var/run/docker.sock
rm -rf /var/lib/containerd
rm -r ~/.docker
Write-Log "Docker uninstalled successfully"
exit 0
}
apt update
apt --yes --no-install-recommends install apt-transport-https ca-certificates curl software-properties-common
wget --quiet --output-document=- https://download.docker.com/linux/ubuntu/gpg | apt-key add -
Expand Down

0 comments on commit 3df757e

Please sign in to comment.