Specifying a default Docker storage directory by using bind mount

If you want to use a different default Docker storage directory, you must change it before you install IBM® Cloud Private by using a bind mount.

IBM Cloud Private requires Docker. You can either install Docker on each node or configure your nodes so that the IBM Cloud Private installation process includes Docker installation. See Installing Docker on IBM Cloud Private.

Specifying a default Docker storage directory for manually installed Docker

If you installed Docker on your nodes, take the following steps:

  1. Remove all Docker containers and images.

    sudo docker rm -f $(docker ps -aq); docker rmi -f $(docker images -q)
    
  2. Stop the Docker service.

    sudo systemctl stop docker
    
  3. Remove the Docker storage directory.

    sudo rm -rf /var/lib/docker
    
  4. Create a new /var/lib/docker storage directory.

    sudo mkdir /var/lib/docker
    

    Note: A /var/lib/docker directory with less than 50 GB disk space isn’t supported.

  5. Use bind mount to set the new location. For example, to set the new location as /mnt/docker run the following commands:

    sudo mkdir /mnt/docker
    sudo mount --rbind /mnt/docker /var/lib/docker
    
  6. Start the Docker service.

    sudo systemctl start docker
    

Specifying a default Docker storage directory for automatically installed Docker

If the IBM Cloud Private installation process includes Docker installation, take the following steps:

  1. Create a new /var/lib/docker storage directory.

    sudo mkdir /var/lib/docker
    
  2. Use bind mount to set the new location. For example, to set the new location as /mnt/docker run the following commands:

    sudo mkdir /mnt/docker
    sudo mount --rbind /mnt/docker /var/lib/docker