My understanding was that the primary limitation of running docker on other OSs was the Linux Network containers that made it possible. (Certainly for Macs).
Recently Microsoft announced a beta of a Ubuntu linux user mode running natively on Windows 10. This can run binaries compiled in ELF format on Windows (unlike cygwin which requires a compilation.)
My question is: Can you run Docker natively on the new Windows 10 (Ubuntu) bash userspace?
You can use Docker Desktop for Windows as the engine and Docker for Linux as the client in WSL on Ubuntu / Debian on Windows. Connect them via TCP.
Install Docker Desktop for Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows If you want to use Windows Containers instead of Linux Containers both type containers can be managed by the Linux docker client in the bash userspace.
Since version 17.03.1-ce-win12 (12058) you must check Expose daemon on tcp://localhost:2375 without TLS to allow the Linux Docker client to continue communicating with the Windows Docker daemon by TCP
Follow these steps:
or
To make it permanent:
Add the corresponding variables to .bashrc
Of course, you can install docker-compose
Or using python pip
And Bash completion. The best part:
I've tested it using the 2.1.0.1 (37199) version of Docker Desktop using Hyper-V:
Volumes
Take care when adding volumes. The path
C:\dir
will be visible as/mnt/c/dir
on WSL and as/c/dir/
by docker engine. You can overcome it permanently:You must exit and reload WSL after making the change to wsl.conf so that WSL reads in your changes on launch.
UPDATE
from: What’s new for the Command Line in Windows 10 version 1803
UPDATE
This script and the use of Unix Sockets was included in Pengwin's pengwin-setup.
Regards
As of right now (April 2016) the answer is:
We do not know yet (but probably not).
The facts
The speculation
So the question is whether the syscalls that Docker needs (for chroot and namespaces, among other things) were implemented or not. The answer is to that is likely "no". Docker requires fairly sophisticated (and Linux-specific) functionality for process and resource management, and process isolation. While it is probably possible to replicate all this on Windows, it would be a lot of work, and since the goal of this Windows feature seems to be running Linux userspace programs, it seems unlikely they did all the work (and kept it secret).
However, there is no definitive information either way,as far as I can tell.
Existing Docker ports
Of course, if Microsoft decides they want Docker support in Windows 10, they will probably able to offer it. There is some precedent for porting Docker to a different kernel:
No, this is not possible.
Docker needs multiple things in order to run containers:
These are all kernel features that are implemented in Linux. Unfortunately, most of them do not have a similar feature in Windows to use as a replacement (nor in the Linux Subsystem that Microsoft implemented in the Windows kernel). All these need to be provided by the OS.
The first insider preview was released yesterday. I've attempted to install docker but it fails with the following:
So it would appear, that for the first preview it does not currently work. However as many people have speculated, it may work in a future release.
As of the Creator Update (released publicly on June 13, 2017) you can run native Windows executable directly in WSL. This means if you've already installed Docker for Windows you can simply invoke the
docker
binaries installed underC:\Program Files
. Since they end in.exe
the easiest option is to create aliases. Something like the following in your.bashrc
should work:This creates aliases for all the files in the
DOCKER_BIN
directory:One caveat: you'll get an error message like "Unable to translate current working directory" if run from a Linux directory. Just
cd
into a Windows directory (e.g./mnt/c/Users/YourUsername
) and you should be good.Once Docker 1.12 is released and the Linux Docker client is separated, you should be able to run the docker client in Windows 10 bash.
This may not sound like much given you have a Docker Windows client but it's useful if you have Linux toolchains that include docker for it's client-side functionality.
In Windows 10 Version 1607 Build 1493.10 you can successfully install it on Ubuntu Bash, but it doesn't work :(
A simple "docker version" will tell you:
If you then run "sudo docker -d" you get the following error:
So this is definitely a stopper from the bash side.
Nevertheless, you can install Docker for Windows and it works like a charm, you can obviously deploy Linux Servers and everything you need.
As of September 2016, No.
All current implementations of Docker on Windows use virtualisation, Docker 1.12 uses a hypervisor in Windows -thus removing the advantage of containerisation over virtualisation.
Docker needs more than just using Linux systems calls.
It needs process control groups (cgroups), a stackable filesystem (aufs), plus other Linux-based systems outside the kernel.
Neither cgroups nor aufs are natively in the Windows 10 kernel.
There is an implementation of Windows Server 2016 here: https://msdn.microsoft.com/en-gb/virtualization/windowscontainers/quick_start/quick_start_windows_server ..but this will only run some Windows services, e.g. IIS, and not Ubuntu
Docker does not currently work in the current build (14316) - assuming you can get it installed.
From: https://blog.docker.com/2016/07/docker-for-mac-and-windows-production-ready/