If you try to play with Docker and containers on new Windows Server 2016, you do the following:
- Add Containers feature using Server Manager, which is easy to do
- Then you open PowerShell with elevated privileges
- First install the OneGet PowerShell module:
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force
- Next you use OneGet to install the latest version of Docker.
Install-Package -Name docker -ProviderName DockerMsftProvider
At this point, you get an error that "The docker installer requires update KB3176936". What is that about?!? Weird. What you need to do is to run sconfig, then choose option 6 and then A and A to install all updates. It might take a few minutes to download and install updates, so be patient.
This works for Server 2016 in no-desktop installs as well as with the UI.
- After this you need to restart your server using UI or using Restart-Computer -Force command.
- No you're ready to try to use OneGet to install the latest version of Docker.
Install-Package -Name docker -ProviderName DockerMsftProvider
- After this you need to restart your server using UI or using Restart-Computer -Force command.
Now, you're ready to use Docker. For example, download a pre-created .NET sample image from the Docker Hub registry and deploy a simple container running a .Net Hello World application by running the following command:
docker run microsoft/sample-dotnet
This command will use Docker run to deploy the .Net container. It will take a few minutes to download the container image though.