windowsdockerdocker-containerdocker-for-windowswindows-container

Real location of docker windows container in a windows host?


Question


I would like to know the location of the containers when it comes to a Windows environment (both the container and the host), that is, I would like to know where the container data is after the command: `docker run ...`

Linux containers can be accessed via \\wsl.localhost\docker-desktop-data, but what about windows containers?

That said, it is worth mentioning that both the environment and the container are windows, so I also activated the Switch to Windows container option (in Docker)

Remarks


My intention is to copy the data from the container, not the image.

That is, if there are 1000 files located in C:\Folder in Container A, I want to migrate this Container A containing not only the C:\Folder but all its contents to another host.

From what I understand, a container has isolated files, this means that I can have another container with the same filenames but with different contents.

I want to access the files to perform the migration.

Similar Questions
Keyword Theme URL
Windows container location This is pretty much the same question as mine. Docker Virtual Hard Disk Location
Windows container location If it differs from my question because it deals with answers that point to the Linux environment, not Windows Where are Docker images stored on the host machine?

Justification



My Environment:

enter image description here


Solution

  • I understand why you are asking this, but containers are a bit different than VMs. With VMs, you have a virtual disk that represents the virtual hard drive for the VM. With containers, what you have are layers that combined represent the container image, which is then used to build new container instances. The container image layers are stored, by default, on the C:\ProgramData folder. You can change that via the Docker CLI (not sure on Docker Desktop, it should be possible).

    Now, to your specific question: