Linux containers for Windows
A new big update for the Windows Server operating system will be released soon, in early September a small post about this was published on the TechNet blog , and some of its new features will please Docker users. One of the main news is that
thanks to Hyper-V technology, Docker will now be able to run Linux containers on Windows, similar to Hyper-V Windows containers.
Running Linux containers with Docker requires a minimal Linux kernel and user space for container processes. The LinuxKit toolkit was specifically developed by Docker to create robust, compact, and portable Linux subsystems in which Linux containers are part of the platform.
The following is a preview of LinuxKit for Linux docker containers running on Windows. Work on the prototype continues, and to launch it you need one of the recently introduced assemblies of Windows Server Insider or Windows 10 Insider.
The instructions below were tested on builds 16278 and 16281 of Windows 10 and Windows Server Insider, respectively.
Before you get started, make sure you have Docker for Windows (if you are using Windows 10) or Docker Enterprise Edition (if you are using Windows Server Insider).
To access the LinuxKit pre-build, you can run the following commands in PowerShell (with administrator privileges):
Now download the Docker daemon assembly from the main development branch with a preview version of Linux container support on Windows:
Launch the new Docker daemon from the default installation, which expects data transfer on a separate channel and uses a separate storage:
Launch the Linux container:
Docker has just launched a minimal virtual machine using the LinuxKit instance that hosts the Linux container.
Since this is one of the first preliminary versions, its capabilities are limited, however it supports basic Docker commands, such as
The development of Windows Server Insider assemblies and the support for Linux Docker containers on Windows is at an early stage. Windows developers and server administrators will find it more convenient to work with Linux Docker containers on Windows in the new release of Windows Server. Developers will be able to run Docker containers for Windows and Linux on the same system, which will simplify the assembly and testing of heterogeneous applications consisting of Docker containers for both platforms.
Administrators who prefer Windows will soon be able to easily run software designed specifically for Linux (such as HAProxy and Redis) using the Linux Docker containers on Windows. In particular, these containers make it easy to configure Docker Enterprise Edition and the Universal Control Plane application (which uses components specifically designed for Linux) on the Windows Server operating system.
Hope this guide helps you get started with your own LinuxKit experiments.
thanks to Hyper-V technology, Docker will now be able to run Linux containers on Windows, similar to Hyper-V Windows containers.
LinuxKit: what is it?
Running Linux containers with Docker requires a minimal Linux kernel and user space for container processes. The LinuxKit toolkit was specifically developed by Docker to create robust, compact, and portable Linux subsystems in which Linux containers are part of the platform.
The following is a preview of LinuxKit for Linux docker containers running on Windows. Work on the prototype continues, and to launch it you need one of the recently introduced assemblies of Windows Server Insider or Windows 10 Insider.
Linux container execution on Windows
The instructions below were tested on builds 16278 and 16281 of Windows 10 and Windows Server Insider, respectively.
Before you get started, make sure you have Docker for Windows (if you are using Windows 10) or Docker Enterprise Edition (if you are using Windows Server Insider).
Configuring Docker and LinuxKit
To access the LinuxKit pre-build, you can run the following commands in PowerShell (with administrator privileges):
$progressPreference = 'silentlyContinue'
mkdir "$Env:ProgramFiles\Linux Containers”
Invoke-WebRequest -UseBasicParsing -OutFile linuxkit.zip https://github.com/friism/linuxkit/releases/download/preview-1/linuxkit.zip
Expand-Archive linuxkit.zip -DestinationPath "$Env:ProgramFiles\Linux Containers\."
rm linuxkit.zip
Now download the Docker daemon assembly from the main development branch with a preview version of Linux container support on Windows:
Invoke-WebRequest -UseBasicParsing -OutFile dockerd.exe https://master.dockerproject.org/windows/x86_64/dockerd.exe
Launch the new Docker daemon from the default installation, which expects data transfer on a separate channel and uses a separate storage:
$Env:LCOW_SUPPORTED=1
.\dockerd.exe -D --experimental -H "npipe:////./pipe//docker_lcow" --data-root c:\lcow
Testing
Launch the Linux container:
docker -H "npipe:////./pipe//docker_lcow" run -ti busybox sh
Docker has just launched a minimal virtual machine using the LinuxKit instance that hosts the Linux container.
Since this is one of the first preliminary versions, its capabilities are limited, however it supports basic Docker commands, such as
pull
and run
.What's next?
The development of Windows Server Insider assemblies and the support for Linux Docker containers on Windows is at an early stage. Windows developers and server administrators will find it more convenient to work with Linux Docker containers on Windows in the new release of Windows Server. Developers will be able to run Docker containers for Windows and Linux on the same system, which will simplify the assembly and testing of heterogeneous applications consisting of Docker containers for both platforms.
Administrators who prefer Windows will soon be able to easily run software designed specifically for Linux (such as HAProxy and Redis) using the Linux Docker containers on Windows. In particular, these containers make it easy to configure Docker Enterprise Edition and the Universal Control Plane application (which uses components specifically designed for Linux) on the Windows Server operating system.
Hope this guide helps you get started with your own LinuxKit experiments.