2

I have a Windows Server 2019 VPS(!) machine. Windows Server 2019 keeps recreating folder "C:\ProgramData\docker", even after I manually removed it.

Attempt 1: There's no mention of Docker in my installed programs, so I can't easily uninstall it.

I then tried what's listed here: https://github.com/docker/docs/issues/5905

PS C:\Users\Administrator> UnInstall-Package Docker -ProviderName DockerProvider -Force UnInstall-Package : Unable to find package providers (DockerProvider). At line:1 char:1

  • UnInstall-Package Docker -ProviderName DockerProvider -Force
  •   + CategoryInfo          : InvalidArgument: (Microsoft.Power...ninstallPackage:UninstallPackage)
    

[Uninstall-Package ], Exception + FullyQualifiedErrorId : UnknownProviders,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

PS C:\Users\Administrator> UnInstall-Module DockerProvider -Force PackageManagement\Uninstall-Package : No match was found for the specified search criteria and module names 'DockerProvider'. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:2194 char:21

  • ... $null = PackageManagement\Uninstall-Package @PSBoundParameters
  •                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : ObjectNotFound: (Microsoft.Power...ninstallPackage:UninstallPackage) [Uninstall-Package] , Exception
    • FullyQualifiedErrorId : NoMatchFound,Microsoft.PowerShell.PackageManagement.Cmdlets.UninstallPackage

Attempt 2: I then ran .\docker-ci-zap.exe -folder "C:\ProgramData\docker (see https://github.com/jhowardmsft/docker-ci-zap/blob/master/docker-ci-zap.exe) which removed all containers and the folder, but after a VPS restart it's simply back again.

Attempt 3: I opened Server Manager and saw that server role "Hyper-V" is enabled.

I now suspect that this is creating the docker folder, but I'm not sure. Is it safe to remove this role and won't it break my VPS?

0

2 Answers 2

1
+100

You may use the PowerShell script CleanupAfterDocker.ps1, as described in the article Clean up after yourself Docker. The script cleans up all traces of Docker from the computer before running docker-ci-zap.exe.

If you can see Docker in Settings > Apps, then you may click it and uninstall from there.

1

Grain of salt: I have never used Docker, but I do know Windows Server & google. Here is what I found, if its any help feel free to upvote. https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/configure-docker-daemon#how-to-uninstall-docker

  1. Stop docker
docker swarm leave --force
docker ps --quiet | ForEach-Object {docker stop $_}
docker system prune --volumes --all
  1. Uninstall
Uninstall-Package -Name docker -ProviderName DockerMsftProvider
Uninstall-Module -Name DockerMsftProvider
  1. More things I won't put here because you should read all the details before you make changes that have adverse effects

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .