In this blog post, I’ll show you how to uninstall Docker from Windows Server 2016 Container host using PowerShell.
In my case, I need to uninstall Docker from my Windows Server 2016 Version 1709 and install the Docker Enterprise preview edition.
If you need to downgrade your Docker version visit this article How to Downgrade Docker On Windows Server 2016
I’ll also show in this article how to Install a specific Docker Version on Windows Server 2016 Container Host.
To Install it, I’ll need to first remove Docker completely from the Container Host.
To complete this step I’ll need to run two cmdlets that will Install the DockerProvider Module and the Docker Package.
At the end of the process, I’ll restart my Container Host.
Uninstall Docker Module And Package
The first step In the process Is to uninstall the Docker Module called DockerProvider using the PowerShell cmdlet below:
Once completed, I’ll move to the next cmdlet to remove the Docker package
When I try to type any docker command I’ll get the error message below that will tell me that docker Is not available.
As seen above, the process is not complicated and takes a few minutes to complete.
Now, all I need to do Is to restart the Server and Install a new Docker version.
Both cmdlets are listed below for reference.
Uninstall-Module dockerprovider Uninstall-package docker
Install a Specific Docker Version
To install a specific docker version on Windows Server 2016 Container Host, I will use the commands below:
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
Install-Package -Name docker -ProviderName DockerProvider -Force -MaximumVersion 17.03
As a Windows Containers Engineer, I strongly recommend learning the process of Installing and Uninstalling Docker and installing specific versions.