28

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

7
  • Something is not clear in your question : are you running Docker for Windows or Docker-ce in an Ubuntu virtual machine (which run on windows with a hosted hypervisor -like Virtual Box) ? In case of Docker for windows (Docker Desktop) does this answer to your question : stackoverflow.com/questions/42250222/…
    – jossefaz
    Jun 15, 2020 at 3:41
  • You can't directly access the contents of images from the host; the format they're stored in is opaque and can vary by installation. What are you looking for in this directory?
    – David Maze
    Jun 15, 2020 at 9:40
  • @yAzou I updated my post. and i followed your link and my docker info gives root at /var/lib/docker but there is no such folder, only /var/lib/docker-desktop which is an empty folder. @DavidMaze it makes me feel safe if i know where the image stores. image size is not negligible..
    – shelper
    Jun 15, 2020 at 13:17
  • Have you tried the UI of Docker-desktop as explained in the first answer of the link ? It should show you the exact windows path where images are stored...
    – jossefaz
    Jun 15, 2020 at 13:59
  • @yAzou my docker desktop does not show the path... i think maybe the older version does, but the one i downloaded yesterday does not.
    – shelper
    Jun 15, 2020 at 14:10

3 Answers 3

16

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.

More info

1
  • what happens if you delete it? Feb 3 at 14:42
12

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
2
  • 1
    thanks for that, just to be more specific, it is located at \\wsl$\docker-desktop-data\mnt\wsl\docker-desktop-data\version-pack-data\community\docker\volumes
    – shelper
    Aug 15, 2020 at 17:39
  • 4
    Any idea what the difference between these two distros is? I am confused.
    – Nikki
    Apr 8, 2021 at 15:30
10

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).

1
  • Why are things in docker\overlay2 when everything I read says data should be saved to docker\volumes? Is there some setting I am not doing correctly? My docker\volumes is empty.
    – Nikki
    Apr 8, 2021 at 15:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.