Storing local docker images on External HDD boot2docker
I’m using docker on my macbook air which unfortunately has quite limited hard drive space (120gb).
Was wondering how I could store containers on my external drive instead of the default (which I believe is /var/lib/docker/) ?
EDIT: It is in fact not /var/lib/docker – when using boot2docker I believe the files are stored on the virtualbox instance.
2 Solutions collect form web for “Storing local docker images on External HDD boot2docker”
After clearing your macbook folder, mount your external hard drive on that path:
mount -t <fstype> -o defaults /dev/<your device> /var/lib/docker/
For use with boot2docker, try with something like:
mount -t vboxsf -o uid=1000,gid=50 /dev/<your device> /var/lib/docker/
<your device> could be for example
You can do this by changing file location in docker.
You can go to Preferences->Advanced, and under the storage path change the location to your external hard drive.
View the screenshot for reference