rjurney
rjurney

Reputation: 5162

How do I increase the Docker base volume size on OS X?

I keep running out of space when building an image from a Dockerfile that downloads 6GB of data. I need to expand the base volume size of docker, but I can't find directions that work for OS X. I would like to know how to increase the base volume size for Linux as well as OS X.

Upvotes: 1

Views: 1378

Answers (2)

Chenna V
Chenna V

Reputation: 10523

Take a look at these two links. https://gist.github.com/stefanfoulis/5bd226b25fa0d4baedc4803fc002829e

https://community.hortonworks.com/articles/65901/how-to-increase-the-size-of-the-base-docker-for-ma.html

Similar to VonC's solution but however none of the solutions were able to restore my previous images after resize

Upvotes: 1

VonC
VonC

Reputation: 1330072

See this thread:

If you are using Docker for MAc (ie not based on VirtualBox), there is a VM Disk located in

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

It should be 64Gb

$ qemu-img info Docker.qcow2
image: Docker.qcow2
file format: qcow2
virtual size: 64G (68719476736 bytes)

Don't forget to clean first exited containers and images:

docker rm -v $(docker ps -a -q -f status=exited)
docker rmi $(docker images -f "dangling=true" -q)

You can resize it:

qemu-img resize Docker.qcow2 +5g

And with gparted assigned the new space to that VM.

qemu-system-x86_64 -drive file=Docker.qcow2  -m 512 -cdrom ~/Downloads/gparted-live-0.25.0-3-i686.iso -boot d -device usb-mouse -usb

Check your log space first though

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

Upvotes: 2

Related Questions