UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).
If you are getting the error: No space left on device
Configuring the qcow2 size cap is possible in the current versions:
# my disk is currently 64GiB
$ /Applications/Docker.app/Contents/MacOS/qemu-img info ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
image: /Users/djs/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
file format: qcow2
virtual size: 64G (68719476736 bytes)
disk size: 28G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: true
refcount bits: 16
corrupt: false
# I can increase or decrease the default cap by:
$ cd ~/Library/Containers/com.docker.docker/Data/database/
$ git reset --hard
HEAD is now at 8635944 last-start-time changed at 1480009710
# The com.docker.driver.amd64-linux/disk/size file (and the disk dir) may not exist. If they don't exist create them.
$ cat com.docker.driver.amd64-linux/disk/size
65536
$ echo 131072 > com.docker.driver.amd64-linux/disk/size
$ git add com.docker.driver.amd64-linux/disk/size
$ git commit -s -m 'increase size to 128GiB'
[master 60861de] increase size to 128GiB
1 file changed, 1 insertion(+), 1 deletion(-)
# delete the disk -- this unfortunately deletes all images and containers
$ rm ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
# now I need to restart the app
For anyone wanting to use an external drive, you can also change the location of the Docker.qcow2 by editing the database key com.docker.driver.amd64-linux/disk/path. There is no UI element for this yet.
Credit for this procedure goes to @djs55 and was taken from docker/for-mac#371 (comment) .
Doesn't work in 17.09.0-ce-mac35. If you roll back to 17.06.2-ce-mac27, that works fine. Upgrading to 17.09 leaves you with a qcow2 file with the correct virtual size, but containers are only given access to 64GB. Creating a new qcow2 on 17.09, Docker uses
com.docker.driver.amd64-linux/disk/path
but ignoressize
.Edit: On a fresh install of 17.09, stopping Docker and running
qemu-img resize Docker.qcow2 +100G
then restarting works. VM looks like it resizes the fs itself. Moving the file seems to be broken via the UI though docker/for-mac#2170