How do I change the Docker image installation directory?

Check this

I have followed instructions in Runtime directory and storage driver on Ubuntu 16.04.1:

  1. mkdir /etc/systemd/system/docker.service.d

  2. create some drop-in.conf file in /etc/systemd/system/docker.service.d , e.g. docker-overlay.conf

  3. add these lines into drop-in file, replace “/mnt/docker-data” with your new docker data location:
    [Service]
    ExecStart=
    ExecStart=/usr/bin/dockerd --graph="/mnt/docker-data" --storage-driver=overlay

  4. sudo systemctl daemon-reload

  5. sudo systemctl restart docker