where docker image is stored with docker-desktop for windows?

Viewed 26833

I installed docker-desktop for windows 10 from https://www.docker.com/products/docker-desktop, and I enabled the docker daemon for Linux container. I have my own wsl2 distro called ubuntu, and I enabled the docker-desktop integration with distro ubuntu, and built an image in it. But I cannot figure out where the image is saved. I did some search and found people saying it is in \\wsl$\docker-desktop-data\mnt\wsl\docker-desktop-data\data\docker. I did find this folder, but the whole folder is only a few hundred MB, and my image is several GB. I only find metadata in the folder but not the real image. Someone point out that I can find path to image in docker resources configuration tab, but mine does not show where the docker image is... docker resources

Any one has found the image in similar situation?

UPDATE the volumes are created in the folder: \\wsl$\docker-desktop-data\mnt\wsl\docker-desktop-data\version-pack-data\community\docker\volumes

3 Answers

As per this answer, the Docker VM is stored in the file %USERPROFILE%\AppData\Local\Docker\wsl\data\ext4.vhdx.

This might not be what you're looking for, but I found this thread when looking for the linked one, so this answer might help some other people.

When using WSL integration, docker create two distros

  • docker-desktop
  • docker-desktop-data

You can access it by

\\wsl$\docker-desktop
\\wsl$\docker-desktop-data

Like Max says, Docker for WSL2 creates two distros docker-desktop and docker-desktop-data

After some digging around I finally about the layer data, and it's here: \\wsl$\docker-desktop-data\version-pack-data\community\docker\overlay2

There you can access the layer diffs (not the entire image because that's not how docker stores them), take note though that the folders aren't named after image id nor its repo digest. To find the correct folder you need to run docker image inspect image_id_here and look for GraphDriver.Data.UpperDir (or just run docker inspect image_id_here -f "{{.GraphDriver.Data.UpperDir}}") which will contain the folder name after /overlay2/.

Note: \\wsl$\docker-desktop-data\mnt\wsl\docker-desktop-data\ is redundant, that same path can be simplified to just \\wsl$\docker-desktop-data\ (for some reason, some distros are mounted to themselves).

Related