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
- Specifying a default Docker storage directory for automatically installed Docker
Specifying a default Docker storage directory for manually installed Docker
If you installed Docker on your nodes, take the following steps:
-
Remove all Docker containers and images.
sudo docker rm -f $(docker ps -aq); docker rmi -f $(docker images -q)
-
Stop the Docker service.
sudo systemctl stop docker
-
Remove the Docker storage directory.
sudo rm -rf /var/lib/docker
-
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. -
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
-
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:
-
Create a new
/var/lib/docker
storage directory.sudo mkdir /var/lib/docker
-
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