Body: <p>I'm learning about Docker. I feel stuck at the moment, I think that I have some wrong concepts about how Docker works, and that shadows how it actually works, but I can't really locate the problem. I will try to write a quick overview how I now think Docker works, please bear with me. At the moment I only want to make it work only on my local machine, hence nothing is deployed to a server in the outside world.</p>
  <p>I have a WSL 2 Ubuntu distro installed on top of Windows 10. This means that I have virtualized my hardware to create a VM to run Ubuntu. In that VM, I want to create Docker containers, that will virtualize the Ubuntu OS, and share the kernel, creating containers where I can run my app.</p>
  <p>In containers, there is no hypervisor, but still there is a thing that handles resources and other things. This is the Docker engine, in my setup the Docker Desktop for Windows, that contains the Docker engine. Here things start to get shady. Alongside the Ubuntu distro, I have two other WSL distros, docker-desktop and docker-desktop-data. It seems like these are used to implement Docker on WSL 2, and they are corresponding for a virtual machine running the Docker engine, and one for holding images, respectively.</p>
  <p>The Docker Desktop installed on Windows is connected to the WSL environment. The Docker host is the docker-desktop distro, while the images are stored in the docker-desktop-data. This is the host that I connect to with my client to use the images that I create / download. I tried to see where my docker images are stored, I could not find them where some sources say they should be, but I found a folder dynamically growing when I am creating images, and that is <code>C:\Users\Username\AppData\Local\Docker</code>. But how come they are on the Windows file system (their routes from Linux being <code>mnt/Users/Username/...</code>) and not somewhere 'nearer' to the files separated for Linux Distros? And if it's stored there, why do my images need contexts for building? Is it the goal for these two distros, or are they doing something else as well?</p>
  <p>These are a lot of questions. Please understand that I don't necessarily want the low-level implementations, I just want to see where are the many moving parts connected. Anything shedding some light on these questions would be really appreciated.</p>
  
Comments: CC BY-SA 4.0
Comments: 2021-01-25T17:30:50.937Z
Comments: Partial answer I found at least related to my question:
  https://stackoverflow.com/questions/61083772/where-are-docker-volumes-located-when-running-windows-and-wsl
Comments: szeb
Comments: CC BY-SA 4.0
Comments: 2021-02-01T21:48:29.663Z
Comments: check the official documentation of docker @ https://docs.docker.com/
Comments: Max N
Tags: <docker><images><virtualization>
Title: Where are Docker containers stored on disk?
UserDisplayName: szeb
ThreadText: # Where are Docker containers stored on disk?
  
  (Asked by: username_0 on 2020-12-19)
  
  I'm learning about Docker. I feel stuck at the moment, I think that I have some wrong concepts about how Docker works, and that shadows how it actually works, but I can't really locate the problem. I will try to write a quick overview how I now think Docker works, please bear with me. At the moment I only want to make it work only on my local machine, hence nothing is deployed to a server in the outside world.
  
  I have a WSL 2 Ubuntu distro installed on top of Windows 10. This means that I have virtualized my hardware to create a VM to run Ubuntu. In that VM, I want to create Docker containers, that will virtualize the Ubuntu OS, and share the kernel, creating containers where I can run my app.
  
  In containers, there is no hypervisor, but still there is a thing that handles resources and other things. This is the Docker engine, in my setup the Docker Desktop for Windows, that contains the Docker engine. Here things start to get shady. Alongside the Ubuntu distro, I have two other WSL distros, docker-desktop and docker-desktop-data. It seems like these are used to implement Docker on WSL 2, and they are corresponding for a virtual machine running the Docker engine, and one for holding images, respectively.
  
  The Docker Desktop installed on Windows is connected to the WSL environment. The Docker host is the docker-desktop distro, while the images are stored in the docker-desktop-data. This is the host that I connect to with my client to use the images that I create / download. I tried to see where my docker images are stored, I could not find them where some sources say they should be, but I found a folder dynamically growing when I am creating images, and that is `C:\Users\Username\AppData\Local\Docker`. But how come they are on the Windows file system (their routes from Linux being `mnt/Users/Username/...`) and not somewhere 'nearer' to the files separated for Linux Distros? And if it's stored there, why do my images need contexts for building? Is it the goal for these two distros, or are they doing something else as well?
  
  These are a lot of questions. Please understand that I don't necessarily want the low-level implementations, I just want to see where are the many moving parts connected. Anything shedding some light on these questions would be really appreciated.
  
  **Tags:** docker, images, virtualization
  
  > **Comments:**
  > **username_0**: Partial answer I found at least related to my question: https://stackoverflow.com/questions/61083772/where-are-docker-volumes-located-when-running-windows-and-wsl  
  > **username_1**: check the official documentation of docker @ https://docs.docker.com/  
  
  ---
  
  ## 0 answers
  
  