Changing the Data Root Directory
Note: The following are one-time setup steps for Docker. Ensure
that you execute these steps:
- as the root user
- are performed in each AppViewX Cloud Connector node to change the Docker data root
To change the data root directory (if /var/lib has insufficient space to hold the images):
-
View the current root directory using the following command:
docker info -f '{{ .DockerRootDir}}'The name of the current root directory is displayed. For example: /var/lib/docker -
Stop the processes that currently running using the following command:
systemctl stop docker -
Verify Docker status using the following command:
systemctl status dockerSince Docker processes were stopped in step 2, the status will be displayed as Active: inactive (dead) -
Create the Docker directory, which will be your new data root directory, using
the following command:
mkdir /new/path/docker-data-rootFor example, you can choose /home/appviewx/docker-data-root as the new path for the data root directory. -
Copy the content from /var/lib to the new data root directory using the
following command:
rsync -avxP /var/lib/docker/ /new/path/docker-data-root -
To update the path of the Docker daemon file, create or edit the
/etc/docker/daemon.json configuration file to add the following:
{ "data-root": "/new/path/docker-data-root" } -
Restart Docker services using the following commands:
systemctl daemon-reload systemctl start docker -
Verify if the new data root directory has been set as the root directory using
the following command:
docker info -f '{{ .DockerRootDir}}'The output should display the new root directory (for example, /new/path/docker-data-root).
