Parvez Misarwala
Parvez Misarwala

Reputation: 41

The size of docker.qcow2 on mac is much larger than the images that I have

I am using mac machine, and I have only one image of ubuntu:14.04, which sizes to 187.9 MB. I have deleted all containers (running and exited). However when I check the size of docker.qcow2 (/Library/containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2), it shows the size as 1.63 GB. As far as I know, this is the file where all the images are stored in mac. So the size of this file should be 187 MB or less. Any idea of why this size is so big?

Upvotes: 3

Views: 688

Answers (2)

Lukasz Czerwinski
Lukasz Czerwinski

Reputation: 15432

There is a number of cleanups you can do using docker command and tools for Docker. Make sure they do what you want them do and they don't remove too much.

  1. First run system prune (note it removes stuff, so please read the message it displays to make sure it wouldn't remove too much): docker system prune -a
  2. Run this third-party cleaning image: docker run --privileged --pid=host docker/desktop-reclaim-space. It uses fstrim, for more details see link. There is no confirmation message when you run the command, so make sure you know what you're doing :)

My results: before (18 GB) and after (3 GB).

Upvotes: 0

Marian Gilan
Marian Gilan

Reputation: 11

I was facing the same issue, size of my Docker.qcow2 was 13G. So I connected to the Docker host VM directly and rebooted it from the CLI. After that the size went down to 2.2G

Try screen $HOME/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty and you should be able to connect directly to the Docker host.

Upvotes: 1

Related Questions