This script automates the installation of Docker and Docker Compose on various Linux distributions including Ubuntu, Debian, CentOS, and Fedora.
- Detects the Linux distribution and installs the appropriate Docker packages.
- Installs Docker Compose.
- Adds the current user to the Docker group.
- Ubuntu
- Debian
- CentOS
- Fedora
- The script must be run with root or sudo privileges.
- Save the script to a file, e.g.,
whale.sh
. - Make the script executable:
chmod +x whale.sh
- Run the script:
sudo ./whale.sh
After running the script, log out and log back in to apply the Docker group changes.