Where are the docker images located once they are downloaded from docker hub in Mac OSX. For example if I run a command like:
docker run hello-world
the image is downloaded and the container is run but where is that image located on my system?
Note: Where are Docker images stored on the host machine? This question has answers related to linux machine, mainly. The answers for Mac OS X are considering that boot2docker is being used alongside docker installation, which is not the case for me.
The location of the disk image can also be obtained (as mentioned in the docs) by selecting Preferences->Advanced menu from the Docker toolbar icon (works in Docker-CE v17):
Update: As mentioned by @udondan Docker now has a separate 'Disk' tab in Preferences where it shows the disk image location:
This answer doesn't concern the "boot2Docker" version for MAC. Here I have the Version 17.12.0-ce-mac55, you have to keep in mind that Docker is still running in a VM, the system paths are relative to the VM and not from the Mac Osx system. As it says all is contained in a VM file :
Try to run Alpine image with this volume option and the ls command you are able to list the VM host:
After this just try :
Now, you are able to list the docker folder from the WM host
For someone who is using Docker toolbox (that uses docker-machine), the answers concerning boot2docker on Mac OS X is not valid. The docker-machine VM is called "default" and it exists in /Users/<username>/.docker/machine/machines/default/ directory.
Note: I have also added this answer to this question: Where are Docker images stored on the host machine? but I am answering here as well so that it's easier to find the answer for someone specifically looking for Mac OS X and new version of Docker.
And if you are using Docker for Mac then the location is again different, namely:
In my case (Mavericks / docker brew installed / Image name: default) is located under
(You gotta use terminal and not finder to see it. )
To elaborate on how to open these folders in case you are getting now directory because it is a mounted on virtual host not your Mac regular volume
Answer from here
If you want to control the volume from your mac, you can map it while you are creating the container
which will map a directory
mydata
on your container to a directory/path/to_mac/directory/MyHostDir
on your mac