I created this gist on May 25, 2021. It is still an issue as of October 23, 2024. Welcome to the future of web development. Take this Gist to rest and calm down.
- Uninstall docker the normal way (yeah you may have already done that)
- Copy this:
# Leave swarm mode (this will automatically stop and remove services and overlay networks)
docker swarm leave --force
# Stop all running containers
docker ps --quiet | ForEach-Object {docker stop $_}
#just to be sure, sleep 5 seconds
Start-Sleep -s 5
#take ownership of docker files
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 }
#invoke cmd to delete docker files
cmd /c rmdir /s /q "C:\ProgramData\Docker"
- save this as
killDocker.ps1
. - go to start > powershell > run as administrator
- run
.\killDocker.ps1
what this does:
- kills all docker containers, if any
- take ownership of all docker files within
C:\ProgramData\Docker
- remove
C:\ProgramData\Docker
by invoking cmd, because microsoft powershell is struggling to delete symlinks, of which docker has many
grab a coffee....
after 10 minutes or so it should be done. You're welcome.
Thanks, docker got corrupted and wont start. Tried uninstall and install but that didn't work. Used the script to clean docker and install again. Im up and running with container again.