we use VMWare vSphere for VMs in our company.
To automatically create docker hosts we use one simple command:
docker-machine --driver vmwarevsphere .... vm params(cpu,memory,network,name, etc)
It automatically creates new VM machine in our VM cluster, installs docker and then we add it to swarm or create new.
Right now I need to create windows docker hosts to run windows containers.
Docker-machine installs boot2docker.iso after creating VM.
But instead I need VM with microsoft servercore or nano.
How do I do it?
Thanks a lot.
Anton
On a Windows machine with Docker for Windows installed you could run the following command to pull the official images for server or nanoserver
docker pull microsoft/nanoserver
or
docker pull microsoft/windowsservercore
I'm not exactly sure how you're automating this - are you using a dockerfile or docker compose?
Are you talking about setting up the Windows host that runs Docker engine? If so, Docker for Windows CE is meant to be desktop software so not recommended for server side workload. Also, Windows EE Server requires Windows Server 2016 or later. If you would really like to use Windows server core mode, Windows Server 1709 offers that. Still, it quite bit new, so you should not set high expectations just yet.
As per the instruction to install the engine, MS has this.
https://learn.microsoft.com/en-us/virtualization/windowscontainers/quick-start/quick-start-windows-server
Or, equivalent one from Docker here.
https://docs.docker.com/engine/installation/windows/docker-ee/
you are talking about hosting a windows container on VMware vSphere? I don't think this is possible right now, may be in the future. I have no documentation or link to verify my answer but in our company we have a similar situation and use vSphere for VMs and Linux container and Hyper-V in parallel for VMs and windows container.
Related
So I have a use case where I need to detect inside of a WSL2 VM whether the Docker setup is Docker for Windows w/ WSL integration vs Docker just running inside of the WSL VM (say installed directly via apt or dnf). The networking situation between these two use cases is different because with Docker for Windows WSL integration you cannot reach containers by their IP from the WSL VM. This poses some problems for some dev-tooling that we have and wasn't previously an issue with devs running on Linux-native machines but we've recently run into it now that some devs are using Windows machines with WSL and Docker for Windows.
Any thoughts on how I can do this? Look for specific env vars, mount points etc?
Looks like I can just stat /mnt/wsl/docker-desktop and see if that exists.
When using Docker for Windows, you must choose to either use Windows or Linux containers, but you can't use both at the same time. What is the technical reason(s) for this? It's a little counter-intuitive, since each container has its own isolated operating system.
Linux containers on Docker for Windows are not handled by windows itself, but they are using Hyper-V Linux VM - MobyLinuxVM. Hence the necessity to switch between Linux and Windows.
However starting from Windows 1709 and Docker in edge version you can try out linux containers on windows - see: https://blog.docker.com/2017/09/docker-windows-server-1709/
Update
As #v.karbovnichy brought up, technically on Docker for Windows you "can" run linux and windows containers simultanously - you can use docker-machine command to create additional linux-based virtual machine that will run your linux containers. Then, you can connect them into one swarm and, with a dose of good will, you will run linux and windows containers simultaneously on same machine.
docker client command itself can connect to both linux or windows docker-server and "manage" both of them - check docker login - it's widely used in server configurations.
However as stated above, true running linux and windows containers next to each other is in preview state.
Docker ecosystem on your Windows machine contains several components.
One is Docker command line: the docker command that you use for everything-management. The second one is Docker daemon - A self-sufficient runtime for containers, the core.
Docker daemons for Linux Containers and Windows Containers are different, but they listen for connections from the docker client on the same pipe. So one needs to be stopped for other to be started. This is the technical reason that you asked for.
However, you can observe that containers started for ex. in MobyLinuxVM is still running and available for connections when you switch to Windows containers. The only thing here is that you cannot manage them because the Docker daemon for Windows does not know how to manage Linux containers in MobyLinuxVM.
UPDATE: As described in this post,
Docker for Windows 18.02 now supports Linux and Windows containers running side-by-side via LCOW, using a single Docker daemon.
So actually now you can use one docker daemon to manage both worlds, it's just about using the new --platform flag in docker pull.
I am using Win 10 Pro N (Version 1709) as a development machine and Windows Server 2016 Standard (Version 1607) as production server.
I am currently developing an ASP.NET Core 2 application with MongoDb as database.
A couple days ago I first stumbled over the idea, to run MongoDb as a Docker image.
I don't have any experience with Docker so far, but I managed to switch from Linux containers (default) to Windows containers on Windows machines.
Was this a good decision? Or is there any reason why I should use Linux containers instead of Windows containers in my scenario?
What e.g. if I should decide to deploy my application to a Linux server some time? In this case, would it wiser to start with Linux containers right from the beginning?
Docker is not about virtualization but more about isolation.
A windows container will run on a windows host
A linux container will run on a linux host
Then some people wanted to run linux container on windows
First you needed to create a linux vm on windows to run the container
Now you can use LinuxKit to run the container but it's still a light VM
Then some people wanted to run windows container on linux
First you needed to create a windows vm on linux to run the container
Now you can use nothing more as of today
So the best bet is to start with a container aimed at your production servers
If you want to deploy to linux I would advise using linux containers since you then test a more similar setup and are more likely to find issues that will also show in your final deployment.
Other than that linux container technology is more mature and better supported than windows containers.
How do I run Datalab locally when it requires Docker (and Docker Toolbox is not supported as documented here: https://cloud.google.com/datalab/docs/quickstarts/quickstart-local)? The Docker website says Docker requires Windows 10 Professional or Enterprise 64-bit, and most corporate environments don't run Windows 10.
Docker is highly preferred over Docker Toolbox, as its a simpler, self-contained installation, with simpler configuration (since you don't have additional virtualization software to deal with, as you do with Docker Toolbox - namely boot2docker and its underlying functionality). However if you have a setup to run docker on your end, you should theoretically be able to use that for running the Datalab docker container by adapting the instructions.
You do have the option of running everything on a GCE VM.
I was facing the same problem, what I found more comfrotable in the end is to install Ubuntu on Virtual Box. This is free and fairly easy, and from the virtual machine you can use all the Docker and the Google guide to run Datalab locally.
Can anyone tell me whether or not it is possible to host Linux-based docker containers on Windows Server 2016 TP5?
I realize that it would have to be through virtualization, but is it possible using the 'standard' Microsoft installation (MSDN Docs) to host linux images? I know it supports Hyper-V isolation, but is that solely for isolation and not for cross platform compatibility?
Given only a single server, what is the best way to be able to host both Windows-based and Linux-based docker containers?
Do I need to install docker twice?
Should I run a Ubuntu server in a VM through Hyper-V?
Should I use the Docker Toolbox (Docker for Windows doesn't support Server 2016 yet)
This is all just for toying around at home, not an actual production environment.
It appears that there is no way of virtualizing Linux Docker containers on Windows other than installing the Docker Toolbox or running it in a VM.
Personally, I installed Hyper-V and an Ubuntu Server VM in that.
Hyper-V containers in Docker for Windows are only for isolation, not cross platform functionality.