If you are on windows 10 and running windows containers
In the above image, docker is running windows containers. So its showing switch to linux containers.
First run docker info
command (more specific docker info --format “{{json .DockerRootDir}}”
).
You should see root dir as
Docker Root Dir: C:\ProgramData\Docker
Now run a command to pull an image like
docker pull hello-world
After it pulls the image, you can look into the docker root dir.
Notice the current modified date time. In one of the folders you can see the sha of the layers.
Finally, you also have to take a look into the following folder, if you want to know where the images are downloaded. The two folders above and below are
- C:\ProgramData\Docker\image\windowsfilter
- C:\ProgramData\Docker\windowsfilter
Now for linux images.
If your docker is running windows containers, and then if you try to fetch a linux based container such as nginx, like so
docker pull nginx:latest
you will get a message as follows.
latest: Pulling from library/nginx
no matching manifest for windows/amd64 10.0.18363 in the manifest list entries
So switch to linux contaners. See the very first image.
Once the docker for linux is running, run the command again.
docker pull nginx:latest
You can see that image is downloading.
Now where is this image downloaded on your hard disk? docker info command may not help much in this case.
So start again. Click Settings and now "Switch to Windows Containers..."
And now see the path.
On my machine, it's C:\ProgramData\DockerDesktop\vm-data
Note the date modified column. Notice and observe that after you pull or remove a linux based image.
That's a diskspace reserved for linux env, so you will not be able to browse further down to see where the image is.
but if you have to, then launch a linux based VM, install docker and explore the path
/var/lib/docker/
Sometimes you may encounter permission issues. If so see this and this