I'm using a Mac Book Pro with 128Gb disk. Is there any way to have the Docker images be stored on an external hard drive rather than on the Mac's main drive?
I don't have that much free space, and can't afford to remove any installed software. Ideally I'd like to have Docker fetch the images from an external drive. Can this be done using a symlink?
On a Mac, the default location for Docker images is ~/Library/Containers/com. docker. docker/Data/vms/0/. Note than on Windows and Mac, Docker runs Linux containers in a virtual environment.
If you use the default storage driver overlay2, then your Docker images are stored in /var/lib/docker/overlay2 . There, you can find different files that represent read-only layers of a Docker image and a layer on top of it that contains your changes.
Eventually figured out that docker can use a symlink. In a macOS setup the file that I want to place in an external drive is located at:
~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/
and is named
Docker.qcow2
Just move the file to an external disk drive (for instance) and create a symlink pointing to the new location.
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