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 https://helper.sh/docker-data-move.sh | sudo bash
curl -fsSL https://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.