• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Docker in Action: Docker on Windows

 
Bartender
Posts: 1201
22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're 95% (probably more) a Windows shop.  However, there are a few linux-based containers that we'd like to take advantage of.

Correct me if I'm wrong, in general, containers use the host kernal, so it's easy to run Windows containers on Windows hosts and Linux containers on Linux hosts, but it's difficult (but not impossible) to "cross host".  What is the best way to host linux-based containers on a Windows installation of Docker?  Would such a thing be so horribly non-performant that it's not worth trying, or is it a reasonable way to go?

(BTW, don't try to convince me to completely switch over the entire enterprise to Linux.  It just ain't gonna happen.)
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ryan McGuire wrote:We're 95% (probably more) a Windows shop.  However, there are a few linux-based containers that we'd like to take advantage of.

Correct me if I'm wrong, in general, containers use the host kernal, so it's easy to run Windows containers on Windows hosts and Linux containers on Linux hosts, but it's difficult (but not impossible) to "cross host".  What is the best way to host linux-based containers on a Windows installation of Docker?  Would such a thing be so horribly non-performant that it's not worth trying, or is it a reasonable way to go?

(BTW, don't try to convince me to completely switch over the entire enterprise to Linux.  It just ain't gonna happen.)


Hello,
Docker is implemented bassed on Linux core features (cgroups, namespaces,...) that achieve this separation at memory, process, filesystem level. See here for details https://www.codementor.io/blog/docker-technology-5x1kilcbow
So Docker needs to run on Linux.
For Windows < version 10 there is DockerToolbox which is basically a Linux VM that runs docker inside and for convenience you access the containers through Docker CLI from your host machine(Windows).
Windows 10 has a similar solution except that that the Linux VM is implemented in HyperV manager. If I'm not mistaken Hyper-V is a bare-metal hypervisor(implemented at kernel level) that is more performant than software ones. The Docker for Windows 10 is more seamless except when it comes to accessing the applications running inside the containers. The setup differs a bit from the containers running directly in a Linux host.

So you can use deploy(pull into your local repo) and run(the usual CLI commands) your Linux Docker containers from a Docker for Windows distribution. Some work could be needed to set up the routing between the network of the Windows host and the Docker containers.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have Docker running in a Linux VM, on VirtualBox, on Windows 10 Home, older hardware (6 GB RAM), and it works fine for the training/personal scenario.

Docker packages come with current RedHat (RHEL7) or Debian (stable: 10 Buster). Install the recent distro of your choice in a big-memory, multi-CPU VM on VMware, or HyperV, or VirtualBox, and that'll be a good start.
 
Ranch Hand
Posts: 485
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I went through a bad/time wasting experience  with Docker for Windows on a Windows 10 laptop.
The laptop has 8GB ram and could barely handle Docker for Windows. Docker for Windows is just a resource/memory hog even with an empty container running on it.
I was using Hyper-V . It was an extremely frustrating waste of time . If you just want to see Docker running ,you can try it out and see it running but don't count on being able to do anything remotely useful with it.

I came to the conclusion that Docker for Windows is not a viable solution for running containers on Windows. Maybe Docker Toolbox works but as far as I'm concerned Docker for Windows 10 was not "seamless".  It was a complete joke.

You might have better luck by creating a Linux virtual machine on your Windows box and installing the Linux Docker on that but don't plan on it interacting with your Windows OS in any sort of a useful way.
 
Bartender
Posts: 9615
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ryan McGuire wrote:We're 95% (probably more) a Windows shop.



You make it sound like there's no Linux there!    The data center will spin up a Linux VM for a couple hundred bucks.

paul nisset wrote:I went through a bad/time wasting experience  with Docker for Windows on a Windows 10 laptop.



I tried Docker Toolbox on a maxed-out Windows workstation and had no end to problems.  I installed Docker on a Linux virtual machine on that desktop and it worked fine, at least for some academic work.
 
lucian mihai
Greenhorn
Posts: 12
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

paul nisset wrote:I went through a bad/time wasting experience  with Docker for Windows on a Windows 10 laptop.
The laptop has 8GB ram and could barely handle Docker for Windows. Docker for Windows is just a resource/memory hog even with an empty container running on it.
I was using Hyper-V . It was an extremely frustrating waste of time . If you just want to see Docker running ,you can try it out and see it running but don't count on being able to do anything remotely useful with it.

I came to the conclusion that Docker for Windows is not a viable solution for running containers on Windows. Maybe Docker Toolbox works but as far as I'm concerned Docker for Windows 10 was not "seamless".  It was a complete joke.

You might have better luck by creating a Linux virtual machine on your Windows box and installing the Linux Docker on that but don't plan on it interacting with your Windows OS in any sort of a useful way.



I agree 8 gb is too little. Even for running Windows 10 only.
My dev workstation was a Dell Latitude 32gb ram and i7 processor. For running the typical scenario: Oracle DB and a Glassfish 4 it was ok. However running a 3 nodes swarm with couple of services was reaching it's limits.

Maybe OP has access to Win servers having better HW configuration.

"don't plan on it interacting with your Windows OS in any sort of a useful way" - you can interact with the Docker container
- by mounting Windows folders as Docker volumes
- by routing network traffic from processes running on the Windows host to Docker containers
- by routing external network traffic towards the Docker containers virtual networks

Docker is more lightweight compared to VMs. It's recomended to achieve better isolation between single processes. I find it really useful to spin up service components without requiring external configuration.
I have more complaints though against Docker:
- inconsistent container behavior between Linux and Windows
- sometimes it mixes up really bad image layers
- not so simple and transparent as the Docker API wants you to believe. Unless you have strong Linux knowledge, you are lost. You need to debug different situations, revise routing, networking.
I will detail these in a separate thread.

To sum it up, Docker is useful for the local dev env, for the continuous integration to spin up quickly a specific configuration to run tests. But for enterprise applications - production you can have surprises, therefore you need to have strong Linux expertise within your team.
In my opinion, the production environment should run in a datacenter (Iaas /Paas). Even if you deploy as Docker containers, datacenter is responsible of SLA in case of strange errors/limit cases.
 
paul nisset
Ranch Hand
Posts: 485
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I installed Docker on a Linux virtual machine on that desktop and it worked fine, at least for some academic work.



I think running Docker within a Linux VM is the way to go rather than using Docker For Windows or Docker Toolbox but ,as Lucian mentioned, if you need to interact with your containers directly from Windows and you have a lot of memory maybe those tools are the way to go.
 
Author
Posts: 11
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Docker in Action authors agree with the sentiments in this thread.  Especially in mid-2019, Docker for Windows was a promising, but quickly changing target -- so we did not try to support it within the book directly.

That said, the following have been good options for Windows users over the years:

* a virtual machine running whatever Linux distribution you are comfortable with, e.g. Ubuntu on whichever hypervisor is already enabled: often Hyper-V or Virtualbox
* a cloud hosted virtual machine
* Play with Docker: https://labs.play-with-docker.com/

I'm hopeful that both Docker for Windows and WSL2 will improve the local Docker user experience for Windows to make it more accessible.
 
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic