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):

  1. 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
  2. Stop the processes that currently running using the following command: systemctl stop docker
  3. Verify Docker status using the following command: systemctl status docker
    Since Docker processes were stopped in step 2, the status will be displayed as Active: inactive (dead)
  4. Create the Docker directory, which will be your new data root directory, using the following command: mkdir /new/path/docker-data-root
    For example, you can choose /home/appviewx/docker-data-root as the new path for the data root directory.
  5. 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
  6. 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"
     }
    
  7. Restart Docker services using the following commands:
    systemctl daemon-reload
    systemctl start docker
  8. 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).