Store Docker image files in external drive in El C

2019-04-26 17:11发布

问题:

Docker newbie here. I'm using a Mac Book Pro with 128Gb disk. Is there any way to have the docker images be stored in 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?

Thanks

回答1:

Eventually figured out that docker can use a symlink. In a Mac OS 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



回答2:

I was able to get this working and documented it here. It is basically a symlink to the folders mentioned.



标签: macos docker