Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
1. Introduction
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.
2. Requirements
In order to work on NanoServer container, you will need to meeting the following requirements below.
- Hyper-V Feature in Windows 10
- Containers Feature in Windows 10
- Docker (Download here)
3. Preparation on Windows 10
Let us begin in preparing your Windows 10 to run Windows Server Insider Preview container.
3.1. Install Hyper-V and Containers Windows 10 Features
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 ;
3.2. Validate Hyper-V and Containers Windows 10 Features are Enabled
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 $_ ; } ;
3.3. Download Docker using PowerShell
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' ;
3.4. Install Docker using PowerShell
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.
3.5. Switch Docker Linux Containers to Windows Containers engine using PowerShell
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 ;
3.6. Validate Docker is on Windows Containers engine using DockerCLI
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
3.7. Install PowerShell for Docker (Optional)
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.
3.7.1. Install NuGet Package Manager
Firstly, you will have to install the NuGet Package Manager.
# Install NuGet Package ManagerInstall-PackageProvider ` -Name NuGet ` -MinimumVersion 2.8.5.201 ` -Force ;
3.7.2. Register the PowerShell for Docker Repository
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 ;
Once you have registered the repository, you can validate the PowerShell for Docker Repository is registered as below.
# Validate the PowerShell for Docker Repository# is registeredGet-PSRepository ` -Name DockerPS-Dev ;
3.7.3. Install the PowerShell for Docker module
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 ;
You can validate if the PowerShell for Docker module has been installed as below.
# Validate the PowerShell for Docker development module# is installedGet-InstalledModule ` -Name Docker ;
3.7.4. Import the Docker PowerShell Module
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 ;
4. Getting Started with Windows Server Insider Preview Container
With the system prepared, let get some fun in containerisation by get an image online and create your very first container.
4.1. Pull a Windows Server Insider Preview Container image
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" ;
4.2. List all available images
Validate NanoServer image available after the DockerCLI Pull Request.
You can do this using DockerCLI pull command as below.
# 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 ;
4.3. Create a new Windows Server Insider Preview container from the image
Now, let us create a Windows Server Insider Preview container.
You can do this using DockerCLI pull command as below.
# 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 ;
4.4. List all available containers
Validate the new NanoServer container is created.
You can do this using DockerCLI pull command as below.
# 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 ;
4.5. Start the container
Now that we have prepare the container, we can start the container and enter into the NanoServer container session interactively.
You can do this using DockerCLI pull command as below.
# 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 ;
5. Conclusion
There you have it. Windows Server Insider Preview in a nutshell for testing and development.
6. Reference
- Windows Blog - Announcing Windows Server Insider Preview Build 16237
- TechNet Blog - Windows Server for Developers: News from Microsoft Build 2017
- Microsoft Docs - Using Insider Container Images
- GitHub - PowerShell for Docker
- GitHub - PowerShell for Docker - PowerShell Help
- DockerHub - Windows Server Core Insider
7. See Also