简体   繁体   中英

How to uninstall Docker Machine under Windows 10

I didn't found any solution to remove Docker Machine from my Windows 10 Edu, but documentation for Docker Machine on Windows is very rare.

I'm a newbie on Powershell so maybe there is a simple command that I didn't found...

go to C:\\Program Files\\Docker , by opening cmd as administrator.

run takeown /R /F *

run ICACLS * /T /Q /C /RESET ,

** don't run in Program files folder, otherwise you will go to bootloop after restart, go to Docker folder first.

Create the small file with following content and saved with extension .ps1 in Program files folder, and right click on it and Run with Powershell .

kill -force -processname 'Docker for Windows', com.docker.db, vpnkit, com.docker.proxy, com.docker.9pdb, moby-diag-dl, dockerd

try {
    ./MobyLinux.ps1 -Destroy
} Catch {}

$service = Get-WmiObject -Class Win32_Service -Filter "Name='com.docker.service'"
if ($service) { $service.StopService() }
if ($service) { $service.Delete() }
Start-Sleep -s 5
Remove-Item -Recurse -Force "~/AppData/Local/Docker"
Remove-Item -Recurse -Force "~/AppData/Roaming/Docker"
if (Test-Path "C:\ProgramData\Docker") { takeown.exe /F "C:\ProgramData\Docker" /R /A /D Y }
if (Test-Path "C:\ProgramData\Docker") { icacls "C:\ProgramData\Docker\" /T /C /grant Administrators:F }
Remove-Item -Recurse -Force "C:\ProgramData\Docker"
Remove-Item -Recurse -Force "C:\Program Files\Docker"
Remove-Item -Recurse -Force "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Docker"
Remove-Item -Force "C:\Users\Public\Desktop\Docker for Windows.lnk"
Get-ChildItem HKLM:\software\microsoft\windows\currentversion\uninstall | % {Get-ItemProperty $_.PSPath}  | ? { $_.DisplayName -eq "Docker" } | Remove-Item -Recurse -Force
Get-ChildItem HKLM:\software\classes\installer\products | % {Get-ItemProperty $_.pspath} | ? { $_.ProductName -eq "Docker" } | Remove-Item -Recurse -Force
Get-Item 'HKLM:\software\Docker Inc.' | Remove-Item -Recurse -Force
Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\Run -name "Docker for Windows" | Remove-Item -Recurse -Force
#Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | ForEach-Object {Get-ItemProperty $_.PSPath} | Where-Object { $_.ToString().Contains("Docker for Windows.exe") } | Remove-Item -Recurse -Force $_.PSPath
#Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | Where-Object { $(Get-ItemPropertyValue $_) -Contains "Docker" }

Docker提供了一个Powershell脚本 ,可以在Windows 10上完全删除Docker。

You can uninstall docker by simply disabling it from startup app in the task manager. After disabaling it just reboot your system and uninstall it from control panel.

Yeah ... if Docker was installed through a normal process then it should appear in your Control Panel > Programs > Programs and Features and should allow you to uninstall it.

If you were the user to install it, then you should be able to uninstall it, otherwise you might need administrator access to do it.

EDIT Okay so if you want to remove the image itself, first run "docker images" and then "docker rmi [image_id]".

If you want to remove the container first run "docker ps -a" to get a list of running containers. If your container is in the list run "docker stop [container_id]". If your container is stopped or not running than run "docker rm [container_id]".

I have the same problem but I fix it with two steps.

  1. Stop docker service
  2. End task the docker from task manager

Then try normal uninstall.

Running registry clean inside CCleaner allows you to install a new version of docker. You can then uninstall docker again

C:\Program Files\Docker>[15:01:17.869] [UninstallWorkflow] Reading installation 
manifest
[15:01:21.484] [UninstallWorkflow] Running before uninstall actions
[15:01:21.486] [UninstallWorkflow] Proceeding with CommunityInstaller.ExecAction
[15:01:23.467] [UninstallWorkflow] Action CommunityInstaller.ExecAction failed
Exception type: System.InvalidOperationException, Exception message: Process 
InstallerCli.exe exited with code 1, StackTrace:
at CommunityInstaller.ExecAction.<DoAsync>d__28.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
atSystem.Runtime.CompilerServices.TaskAwaiter.
HandleNonSuccessAndDebuggerNotification(Task task)
at CommunityInstaller.UninstallWorkflow.<ProcessAsync>d__11.MoveNext()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM