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

  • kafka on kubernetes cannot produce/consume topics (ClosedChannelException, ErrorLoggingCallback)
  • Using VNCserver + GUI application + Virtual Display in Docker container
  • Can't get clipboard forwarding working, while being in Docker under SSH
  • docker cannot specify container connection
  • Deploying a minimal flask app in docker - server connection issues
  • Postgres networking with Docker containers and host LAN
  • EDIT: It is in fact not /var/lib/docker – when using boot2docker I believe the files are stored on the virtualbox instance.

  • Docker container calls binary from another container
  • Connect to vagrant from docker via php
  • Resources are missing from JAR file after repackage with spring boot maven plugin
  • Is docker swarm manager part of the swarm cluster?
  • Proxying http requests to another docker container
  • trying to do apt-get with docker, causing error 100
  • 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.