Search code examples
macosdockerdocker-for-macdocker-desktop

What is location of images pulled from Docker Hub via Docker for Mac


*Note: I know about this question, however, it is related to Docker Toolbox and not to Docker Desktop for Mac and it seems that each tool uses different location for storing Docker images locally

Where can I find a docker images that have been pulled from Docker Hub by means of Docker desktop for Mac?

I tried to verify that Docker is running by the following command.

docker run hello-world

As a result the Docker daemon pulled the "hello-world" image from the Docker Hub but I am not able to find it.


Solution

  • It should be in

    $HOME/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
    

    with Docker.qcow2 being the filesystem for the "vm" that Docker for Mac runs in.
    See issue 23437.

    That means removing the images (thread 15194: docker images -q |xargs docker rmi --force) won't decrease the space occupied by Docker.qcow2 (and the disk space on the disk).
    To the point you start seeing aliases like this one:

    shrink-qcow2 () {
         mv ${1} ${1}.BACKUP && qemu-img convert -O qcow2 ${1}.BACKUP ${1}
    }