26

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...

Thibault
  • 842
  • 2
  • 8
  • 16
  • control panel >> programs and features?? – 4c74356b41 Feb 10 '17 at 14:13
  • No there is only Docker, I've installed Machine by curl (https://docs.docker.com/machine/install-machine/) – Thibault Feb 10 '17 at 14:16
  • 1
    It's a self contained program so you only need to delete 'docker-machine.exe' from your bin folder. – henrycarteruk Feb 10 '17 at 14:32
  • `docker-machine.exe` is already deleted, it was in $home/bin/ and I didn't copied it or moved anywhere. I'm almost sure that there no more mark of it but I can still use docker-machine with ls create or whatever ! :/ – Thibault Feb 10 '17 at 14:57
  • If Monday I have no answer I'll probably delete everthing, it'll make me loose time but less than waiting for a precise answer :) – Thibault Feb 10 '17 at 15:25
  • Have you tried this manual? https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon#how-to-uninstall-docker – Ilya Serbis Jul 11 '21 at 15:05

5 Answers5

20

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" }
GD- Ganesh Deshmukh
  • 1,456
  • 3
  • 24
  • 36
  • 14
    it apparently doesn’t. I re-downloaded the installer program, but when I run it, it throws the following message: Docker Desktop 2.0.0.3 Existing version is up to date. and a Close button. Found the solution, and of course it involves the Windows Registry. The was a key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall called “Docker Desktop.” I deleted it and all of its sub-keys and the Docker installation then went to completion. – Mitendra Mar 31 '20 at 09:02
  • 3
    @Mitendra's observation can be accomodated like follows: `Get-Item HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* | Where-Object -FilterScript { $_.GetValue("DisplayName") -match "Docker" } | Remove-Item -Recurse -Force` – Mavaddat Javid Jan 20 '22 at 02:03
  • 1
    THANK YOU! Months I've been trying to remove this – beirtipol Feb 21 '22 at 22:49
  • The first two commands worked for me. Since I already had removed the docker service, I haven't needed to use the script. thanks – Alex Apr 01 '22 at 09:45
5

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.

4b0
  • 21,981
  • 30
  • 95
  • 142
Mohamed Salah
  • 160
  • 1
  • 5
3

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.

Virendra
  • 665
  • 5
  • 6
  • 1
    why i have bug in docker start up uninstalling it and . and installing it again does not solve the issue. it always crashes docker failed to start – zero8 Aug 21 '20 at 02:57
1

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 just want to remove Machine and not Docker in general, in the control panel there is just Docker and not Machine that I've installed through curl (https://docs.docker.com/machine/install-machine/) – Thibault Feb 10 '17 at 14:18
  • Docker Machine is not a container, its a tool that you have to download, normally a simple remove of the file you've downloaded with curl "uninstall" Machine... But I can't find any docker-machine.exe on my computer and a `gci -recurse -filter "docker-machine.exe"` don't return anything... – Thibault Feb 12 '17 at 12:01
1

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

Berty
  • 1,081
  • 1
  • 18
  • 49