Reputation: 433
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?
Upvotes: 23
Views: 16475
Reputation: 994
I was able to get this working and documented it here:
This tutorial will explain how to setup an external disk to store docker images and containers.
It is basically a symlink to the folders mentioned.
Upvotes: 4
Reputation: 433
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.
Upvotes: 15
Reputation: 3379
Please create a symlink to your desired external drive location:
~/Library/Containers/com.docker.docker
to your external drive locationEHOME=/Volumes/<your-external-drive-name>
ln -s $EHOME/Library/Containers/com.docker.docker ~/Library/Containers/com.docker.docker
Upvotes: 4