Issue
Unable to remove/uninstall Docker Dev version from Windows Server
Applies to Windows Server 2016/2019 on virtual machine or physical server
Symptom
- Even after uninstalling Docker from Windows Server, dockerd service is still running
- Failed to install Docker EE (Enterprise Edition) on Windows Server as there is Docker is already running on the host machine
Cause
Docker Dev version was installed using Docker Manifest files (using docker.exe and dockerd.exe files). We have to remove dockerd service and associated file/registry for Docker
Steps already followed to uninstall Docker
1. Remove DockerMsftProvider and docker module
Uninstall-Package -Name docker -ProviderName DockerMsftProvider
Uninstall-Module -Name DockerMsftProvider
2. Remove Docker default Networks
Get-HNSNetwork | Remove-HNSNetwork
Windows Server 2016
Get-ContainerNetwork | Remove-ContainerNetwork
Solution
1. Delete Docker Service
sc delete [service name]
2. Delete Registry Key for Docker
Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\docker
3. Remove the Environment Variable:
Control Panel\System and Security\System\AdvancedSystemSettings\EnvironmentVariable
TEMP: Path
Delete Path Created for Docker
4. Removed Docker Program Data
Remove-Item "C:\ProgramData\Docker" -Recurse
5. Removed Docker files from C:\Program Files\docker
6. Restart server
Restart-Computer -Force
Optional Step
7. Removed Container Feature
Remove-WindowsFeature Containers