Last year Microsoft has partnered with Docker Inc to provide the next generation applications called Containers. As a result of the journey towards heterogeneous apps, Microsoft has released the GA version of Docker CLI for Windows last week. As of today, using this tool you can manage Linux containers hosted in Azure or your own VMs straight from your Windows desktop. Microsoft plans to introduce their own container technology as below.
Windows Server containers
The idea behind this container is similar to Linux Container technology. Containers are isolated, but they share OS kernel and, where appropriate bins/libraries. Simply put we are talking about OS Virtualization where applications doesn’t need to be OS specific.
Using Microsoft Hyper-V technology these containers are fully isolated from the OS itself by running on the hypervisor layer. This ensures that one container has no impact on it’s host or any other containers in the same system. Even though these containers are running inside a hypervisor it doesn’t have any restriction over container deployment. You can simply deploy containers that you targeted for Windows Server in Hyper-V containers and vice versa without any modification.
Microsoft’s Nano server is the Windows version of Red Hat’s Atomic host, an OS designed to run containers in cloud. This version of Windows has no GUI stack, 32 bit support (WOW64), MSI and a number of default Server Core components has also been taken off. Also local logon and Remote Desktop has been removed and managing a nano server can be done only via WMI and PowerShell. As per Microsoft nano server has 93% lower VHD size, 92% fewer critical bulletins and most importantly 80% fewer reboots.
Installing Docker CLI in Windows
There are two methods currently supported for installing Docker CLI for Windows.
Boot2Docker will install a tiny Linux VM running on Virtual Box (Yes you will have to disable Hyper-V engine for this). It is a lightweight linux distro called Tiny Core Linux specifically designed to run Docker containers. You can download the Windows version from here.
This is Machine Package manager like built for Windows.Think it as YUM or apt-get for Windows. Installation is rather simple. Let’s see how we install Docker CLI using this method. You can visit their website for more information on all supported packages other than Docker.
- Open a Command Prompt as admin and execute below command.
C:/>@powershell -NoProfile -ExecutionPolicy unrestricted -Command “iex ((new-object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1’))” && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
- Once it finishes open a PS seesion as an administrator and set the execution policy to at least Bypass. Then type the below command to proceed.
PS:/>iex ((new-object net.webclient).DownloadString(‘https://chocolatey.org/install.ps1’))
- Now it’s time to install the Docker CLI. Using either PowerShell or Command prompt execute below command to install Docker CLI.
C:/>choco install docker
- To upgrade the Docker Client type choco upgrade docker
Microsoft loves open source and I for one a Linux fan. Last month Microsoft has announced a partnership with Docker Inc to include Windows containers in vNext Windows server editions. Also Microsoft Azure supports Linux VMs running Azure configured with Docker containers.
The limitation to use a Linux client machine or boot2docker program on Windows to access Docker containers has been removed. Microsoft has introduced a CLI for Windows which can directly access same. It’s a actually a docker program running under windows command line.
For more information on how to build the Docker CLI in windows please refer below articles.
- Building Docker CLI in Windows
- Docker Private Registry in Azure