I have a large (100gb+) database that I'm trying to run with the official postgres image.
I can't store the data in a docker volume because the ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/Docker.qcow2
file in Docker for Mac has a size limitation of about 60gb.
I'm hesitant to mount a host directory as a volume because file access in mounted host directory volumes is much slower than regular volumes.
These are some useful links that go into more detail on these issues:
Do you all just eat the speed loss and mount a host directory? Do you manually create a qcow2 file that can grow larger with qemu (if you do this, do you need to maintain this file between upgrades)? Do you do something else to handle this issue?
eventually this guide helped me to resize/expand my docker volume. 2 - Shut down your VM, open VM Settings > Hard Disk(s) > change size of your 'virtual_disk. vmdk' (or whatever is your machine's virtual disk), then click Apply (see this guide).
qcow2 file causing it to grow in size, until it eventually becomes fully allocated. It stops growing when it hits this maximum size. You can stop Docker and delete this file, however deleting it will also remove all your containers and images.
There is a size limit to the Docker container known as base device size. The default value is 10GB. This value can be changed to allow the container to have more size using dockerd --storage-opt dm. basesize=50G .
To view the approximate size of a running container, you can use the command docker container ls -s . Running docker image ls shows the sizes of your images. To see the size of the intermediate images that make up your image use docker image history my_image:my_tag .
The following script delete and re-create a new shrinked Docker.qcow2 file preserving the images passed as arguments.
https://blog.mrtrustor.net/post/clean-docker-for-mac/
Hope this helps.
For a situation like this, I would definitely recommend creating a qcow image that can grow larger.
It is a relatively straightforward process, and you get the performance benefits that are generally quite necessary when running a large database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With