Location of docker images downloaded by Docker (1.9.1) on Mac OS X

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.


And if you are using Docker for Mac then the location is again different, namely:

/Users/MyUserName/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2

The Disk image location can also be seen (as mentioned in the docs) by selecting Preferences->Advanced menu from the Docker toolbar icon (works in Docker-CE v17):

Docker->Preferences->Advanced

Update: As mentioned by @udondan Docker now has a separate 'Disk' tab in Preferences where it shows the disk image location:

Docker->Preferences->Disk


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.


The docker images are stored in a different location on the Mac with Docker Desktop, different to where they are stored on other Linux systems.

Extract from Docker documentation (retrieved 25 March 2020 from https://docs.docker.com/docker-for-mac/space/ )

Docker Desktop stores Linux containers and images in a single, large “disk image” file in the Mac filesystem. This is different from Docker on Linux, which usually stores containers and images in the /var/lib/docker directory.

On my Mac with MacOS 10.14.6 Mojave, running Docker version 19.03.8 that single large file can be found at:

~/Library/Containers/com.docker.docker/Data/vms/0/data/Docker.raw

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

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty 

ls -ltrh /var/lib/docker/volumes

Answer from here

If you want to control the volume from your mac, you can map it while you are creating the container

docker run -it --name voltest2 -v /path/to_mac/directory/MyHostDir:/mydata centos:latest /bin/bash

which will map a directory mydata on your container to a directory /path/to_mac/directory/MyHostDiron your mac