Operations helper

docker-data-move.sh

Bundled from the tool-tl/docker-data-move.sh project and republished through helper.sh for direct execution, operational handoff, and multilingual documentation.

One-liner

curl -fsSL helper.sh/docker-data-move.sh | sudo bash
curl -fsSL helper.sh/docker-data-move.sh | sudo bash -s -- --auto --yes

Requirements

  • Linux host
  • Docker installed
  • rsync installed
  • root privileges
  • jq optional for safer JSON edits

Best for

  • Move Docker from a full root or home filesystem onto a larger mount
  • Standardize recovery steps for low-disk Docker hosts
  • Reduce manual mistakes when updating Docker daemon.json

Highlights

  • Detects the current Docker Root Dir automatically
  • Scans local disks and suggests migration targets by free space
  • Backs up the old Docker data directory and daemon config before switching

Recommended procedure

  1. Inspect the current Docker data-root and estimate required free space.
  2. Pick an appropriate target path interactively or via --auto.
  3. Stop Docker services, rsync the data, update daemon.json, and restart Docker.
  4. Verify the new Docker Root Dir and confirm containers are healthy.

Safety notes

  • Review the script before running it on a production host.
  • Prefer interactive mode first when the storage layout is unfamiliar.
  • Confirm backups and target capacity before adding --yes.

Scenario article

Best use cases for docker-data-move.sh in real operations

A field guide for using docker-data-move.sh when Docker storage outgrows the system disk and manual migration becomes risky.

Related topics

CentOS 7 maintenance and recovery

Keep legacy CentOS 7 hosts installable and maintainable when yum repositories fail, mirrors expire, or Docker data needs to be moved off a crowded disk.

Open topic

Problem pages

How to move Docker data-root on CentOS 7

Move Docker data away from a crowded root or home filesystem before the host runs out of disk.

Open page