A Bash script for Debian/Ubuntu-based systems that will install Docker (if not already installed) and configure it to use a specified directory (presumably on your mounted external drive) for storing containers, images, volumes, etc.
Important Considerations BEFORE Running:
- External Drive MUST be Mounted: This script assumes your external drive is already mounted before you run the script. It does not handle mounting the drive itself.
- Persistent Mount: For Docker to start correctly after a reboot, the external drive must be mounted persistently (e.g., via an entry in
/etc/fstab
) at the same path every time. - Backup: If you have existing Docker data in
/var/lib/docker
and it's important, BACK IT UP before running this script. The script attempts to move existing data, but failures can happen. - Root Privileges: You need to run this script with
sudo
. - Distribution: This script is tailored for Debian/Ubuntu. The package manager (
apt
), repository s