This TechNet Wiki article provides an overview on how to pull a Windows Server Insider Preview container image using Docker and run a Windows Server Insider Preview container using Windows Containers feature on Windows 10. This page focuses on Windows Server Insider Preview deployment preparation in Windows Containers environment with Docker.
With the latest Insider Preview release of Windows Server, Windows Server Insider Preview is the currently the latest Windows Server operating system in Server Core that has been containerization for developers and this walk-through will get you started testing on Windows Server Insider Preview container in your Windows 10 quickly.
↑ Return to Top
In order to work on NanoServer container, you will need to meeting the following requirements below.
Let us begin in preparing your Windows 10 to run Windows Server Insider Preview container.
Firstly, we will need to enable the following Windows 10 Features to start off.
# Enable Hyper-V and Containers Windows 10 Features Enable-WindowsOptionalFeature ` -FeatureName Microsoft-Hyper-V, Containers ` -Online ` -All ;
Next, validate that Microsoft-Hyper-V and Containers are enabled.
# Validate Microsoft-Hyper-V and Containers Windows 10 Features # is Enabled "Microsoft-Hyper-V","Containers" | ` ForEach-Object { ` Get-WindowsOptionalFeature ` -Online ` -FeatureName $_ ; } ;
Once we have validated Windows 10 requirements are met, let us download the Docker for Windows package using PowerShell
# Download Docker package Invoke-WebRequest ` -Uri 'https://download.docker.com/win/stable/InstallDocker.msi ' ` -OutFile 'C:\Temp\InstallDocker.msi' ;
Once the download has completed, let us install the Docker for Windows using PowerShell.
# Install Docker Start-Process ` -FilePath 'C:\Windows\System32\msiexec.exe' ` -ArgumentList '/I C:\Temp\InstallDocker.msi /quiet' ` -Wait ;
Once the installation has completed, restart your Windows 10.
After a reboot and you have logged into Windows, switch the Docker's default Linux Containers to Windows Containers engine using PowerShell.
# Switch Docker to Windows Containers Start-Process ` -FilePath 'C:\Program Files\Docker\Docker\DockerCli.exe' ` -ArgumentList '-SwitchDaemon' ` -Wait ;
Use the DockerCLI with Info parameter to generate a general information of the system and confirm that it is on Windows 10 operating system instead of Linux.
# Display Docker Information using # Docker Info command docker info
If you are interested in managing Docker containers with PowerShell, you can continue to follow this to obtain PowerShell for Docker module. This is totally optional.
Note: The PowerShell for Docker module is still in development phase at the time of this article is published.
Firstly, you will have to install the NuGet Package Manager.
# Install NuGet Package ManagerInstall-PackageProvider ` -Name NuGet ` -MinimumVersion 2.8.5.201 ` -Force ;
Secondly, you will need register the PowerShell for Docker repository.
# Register the PowerShell for Docker RepositoryRegister-PSRepository ` -Name DockerPS-Dev ` -SourceLocation https://ci.appveyor.com/nuget/docker-powershell-dev ;
# Validate the PowerShell for Docker Repository# is registeredGet-PSRepository ` -Name DockerPS-Dev ;
Finally, you will install the PowerShell for Docker module.
# Install the PowerShell for Docker development module# for current userInstall-Module ` -Name Docker ` -Repository DockerPS-Dev ` -Scope CurrentUser ;
# Validate the PowerShell for Docker development module# is installedGet-InstalledModule ` -Name Docker ;
Once you have installed the PowerShell for Docker module, you will need to load the PowerShell for Docker module into your current PowerShell console.
# Import the installed PowerShell for Docker moduleImport-Module ` -Name Docker ;
To validate that PowerShell for Docker module is loaded on your current PowerShell console, you can use the command below.
# Validate the PowerShell for Docker development module# is loadedGet-Module ` -Name Docker ;
With the system prepared, let get some fun in containerisation by get an image online and create your very first container.
Perform a Pull Request for latest Windows Server Insider Preview Container image using Docker.
You can do this using DockerCLI pull command as below.
# Pull the microsoft/windowsservercore-insider Docker # image using DockerCLIdocker pull microsoft/windowsservercore-insider
Or use the Pull-ContainerImage command from PowerShell for Docker module as below.
# Pull the microsoft/windowsservercore-insider Docker # image using PowerShellPull-ContainerImage ` -Repository "microsoft/windowsservercore-insider" ;
Validate NanoServer image available after the DockerCLI Pull Request.
# List all available images using DockerCLIdocker images
Or use the Get-ContainerImage command from PowerShell for Docker module as below.
# List all available images using PowerShellGet-ContainerImage ;
Now, let us create a Windows Server Insider Preview container.
# Create a new container name WindowsServerInsider# using Docker Create command docker create -t --name WindowsServerInsider -h WindowsServerIn -i microsoft/windowsservercore-insider
Or use the New-Container command from PowerShell for Docker module as below.
# Create a new container name WindowsServerInsider# using PowerShellNew-Container ` -Name WindowsServerInsider ` -ImageIdOrName microsoft/windowsservercore-insider ` -Terminal ;
Validate the new NanoServer container is created.
# List all available containers using DockerCLI docker container ls -a
Or use the Get-Container command from PowerShell for Docker module as below.
# List all available containers using PowerShellGet-Container ;
Now that we have prepare the container, we can start the container and enter into the NanoServer container session interactively.
# Start the Windows Server Insider Preview container # interactively using DockerCLIdocker start -i WindowsServerInsider
Or use the Start-Container command from PowerShell for Docker module as below.
# Start the Windows Server Insider Preview container # interactively using PowerShellStart-Container ` -ContainerIdOrName WindowsServerInsider ` -Attach ;
There you have it. Windows Server Insider Preview in a nutshell for testing and development.