Expected Outcome
Relocate the Docker root directory to a new partition mount without reinstalling Terraform Enterprise.
Prerequisites
- Docker-CE
- Terraform Enterprise
Use Case
Disk space is inadequate in the Docker root directory and you must relocate it without reinstalling Terraform Enterprise.
Procedure
- SSH into the TFE host and stop the Terraform Enterprise application and Replicated services.
# Stop TFE
replicatedctl app stop
# Verify TFE has successfully stopped before proceeding
replicatedctl app status
# Stop the Replicated services
sudo systemctl stop replicated replicated-operator replicated-ui - Next stop Docker and associated services
# Stop Docker
sudo systemctl stop docker
# Stop Docker socket
sudo systemctl stop docker.socket
# Stop Containerd
sudo systemctl stop containerd - Move the contents of Docker root directory to the new partition mount
# Check the current Docker root directory path
docker info -f '{{ .DockerRootDir}}'
/var/lib/docker
# Move the directory or its contents to the new path.(example: /apps)
mv /var/lib/docker/* /apps/ - Create or Edit
/etc/docker/daemon.json
to set the new Docker root dir path
# Use your favorite text editor
sudo vim /etc/docker/daemon.json
# Verify the file is json compliant after saving the changes
python -m json.tool /etc/docker/daemon.json
{
"data-root": "/apps"
}
- Start Docker and verify the new Docker root directory location
sudo systemctl start docker
docker info -f '{{ .DockerRootDir}}'
/apps - Check Replicated is ready and start Terraform Enterprise.
# Check Replicated
replicatedctl system status
{
"Replicated": "ready",
"Retraced": "ready"
}
# Start TFE
replicatedctl app start