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)
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.
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? |
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:
If you want to move container images from one machine to another, the best alternative is to push the image to a registry (such as Docker Hub) to then pull it on another machine. Alternatively, you could rebuild your dockerfile on the other machine (might require other assets, such as the app folder, etc.)
If the goal is to change the Windows config, you should do that via dockerfile, not changing the config directly from the folder structure. This is another main difference from VMs to containers. By changing the dockerfile, you make this reproducible, and avoids any issues with the Windows runtime.