Docker containers in Windows "look" like VMs...

  • Context: Python 
  • Thread starter Thread starter fog37
  • Start date Start date
  • Tags Tags
    Windows
Click For Summary

Discussion Overview

The discussion revolves around the functioning of Docker on Windows, particularly the relationship between Docker containers, virtual machines, and the Windows Subsystem for Linux (WSL). Participants explore the technical distinctions and similarities between these technologies, focusing on how Docker operates within the Windows environment.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant notes the installation of Hyper-V and WSL 2 with Docker on Windows, suggesting that this setup resembles a virtual machine rather than a traditional container environment.
  • Another participant explains that Docker is fundamentally a Linux technology that utilizes a VM on Windows to create a Linux-like environment, emphasizing the lightweight nature of Docker containers on a Linux host.
  • There is a discussion about the distinction between a "sandbox" and a "full virtual machine," with one participant suggesting that this distinction is a matter of degree, as the CPU executes instructions in both cases.
  • A participant shares their use of Docker to run a specific Home Assistant environment on a Linux server, highlighting practical applications of Docker in managing different environments.
  • Another participant draws a comparison between Docker and the VICE application, which emulates Commodore 64 machines, discussing how different architectures affect the operation of virtual machines and the compatibility of images.

Areas of Agreement / Disagreement

Participants express differing views on the nature of Docker's operation on Windows, with some suggesting it functions more like a virtual machine due to the involvement of WSL and Hyper-V, while others emphasize its lightweight container nature. The discussion remains unresolved with multiple competing perspectives on the topic.

Contextual Notes

Participants highlight the complexity of defining the boundaries between containers and virtual machines, indicating that the discussion is influenced by varying interpretations of what constitutes a "sandbox" versus a "full virtual machine." There are also references to specific technical implementations that may affect the understanding of these concepts.

fog37
Messages
1,566
Reaction score
108
Hello,

I am trying to better understand how Docker works under the hood in Windows...I get the difference between virtual machines (guest OS on top of a host OS) and containers (which work with the host OS)...The Docker desktop installation process seems to automatically install both Hyper V and WSL 2 (which is different from WSL1...Hyper V a type of lightweight hypervisor to run and manage virtual machines and WSL2 is really a Linux OS virtual machine... If so, then running Docker in Windows seems to be like running a virtual machine and not a container..

IF the Dockerfile first line is FROM python :3, it means that we are instructing the docker engine to go on Docker hub and downloaed a Docker parent image containing the interpreter python as well as the Linux distribution Alpine....I get Docker is truly a linux application. Now we have both the Alpine Linux distribution and WSL2 which seem to be two Linux operating systems...Again, that looks more like a virtual machine than a container: we have Windows (our host OS), Alpine, and WSL2...

Thank you!
 
Technology news on Phys.org
Docker is a linux technology that runs on windows and macos. On Linux, it takes advantage of some Linux security protections to run code in a sort of sandbox using the same OS. This makes Docker containers very light-weight and reduces system resource usage on a Linux host.

When running on Windows there has to be a VM to run Docker inside. Windows provides the WSL subsystem for that and it is a VM that looks like a linux environment to Docker. It was quite "inspired" by MS to offer this but I guess they saw the writing on the wall with developers bouncing between the two environments. I know they resisted this approach for a long time forcing people to have two machines, or log into a linux machine or use dual boot...

https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux

One thing that I found cool was that the MS VS code editor works in both environments via a web service that runs inside the WSL environment and does the CRLF conversion seamlessly between them. It allows developers to span the environments much more easily.
 
It is probably worth pointing out that the distinction between "sandbox' and "full virtual machine" is also a matter of degree. The CPU is still executing the instructions like it always did.
 


I use Docker to run a specific Home Assistant Linux 'environment' on a general Linux server that handles other networking and processing capabilities for the programs running inside the Docker 'environment'.
 
Vanadium 50 said:
It is probably worth pointing out that the distinction between "sandbox' and "full virtual machine" is also a matter of degree. The CPU is still executing the instructions like it always did.
Yes, this brings up an interesting scenario. Commodore 64 family of machines are emulated in the VICE application. Its like a VM that executes 6502 code on any machine hosting VICE. That means that the 6502 code is "translated" in equivalent machine code of the host machine to run. They even simulate the Commodore address space for peeks and pokes.

I would consider VICE a full blown VM vs something like WSL that runs linux on Windows where the opcodes of the image are the same as the host ie you wouldn't install an Apple M2 linux image on WSL if it is running on an Intel processor since the opcodes are different.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
5K
Replies
6
Views
3K
Replies
13
Views
4K
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K