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/) ?

  • When mounting named volumes, under what conditions is data copied from the container?
  • Swarm Cluster Consul setup
  • Docker : Installing Docker behind a proxy on CentOS 7 : Error while pulling image
  • How to uninstall Docker completely from a Mac?
  • How to connect to a docker container from outside the host (same network) [OSX 10.11]
  • ERROR: Registering runner. forbidden (check registration token)
  • EDIT: It is in fact not /var/lib/docker – when using boot2docker I believe the files are stored on the virtualbox instance.

  • How to “add” the proxy section to configure a registry as a pull-through cache?
  • Docker unable to mount volume with node app
  • How to use GitLab CI in combination with a JUnit Rule that launches Docker containers?
  • How to run docker builds from Jenkins on a Mac?
  • Ruby OOM in container
  • Could not find rake-11.1.2 in rails docker container
  • 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/
    

    where <your device> could be for example sdb.

    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

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.