diff --git a/home/.chezmoiscripts/_universal/run_onchange_before_11-install-docker.tmpl b/home/.chezmoiscripts/_universal/run_onchange_before_11-install-docker.tmpl index a49bcae3..40321bf0 100644 --- a/home/.chezmoiscripts/_universal/run_onchange_before_11-install-docker.tmpl +++ b/home/.chezmoiscripts/_universal/run_onchange_before_11-install-docker.tmpl @@ -31,9 +31,16 @@ elif command -v apt-get > /dev/null; then sudo apt-get update sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin elif command -v dnf > /dev/null; then - # Fedora + . /etc/os-release + if [ "$ID" == 'centos' ]; then + logg info 'Installing Docker on CentOS' + elif [ "$ID" == 'fedora' ]; then + logg info 'Installing Docker on Fedora' + else + logg error 'Unknown OS - cannot install Docker' && exit 1 + fi sudo dnf -y install dnf-plugins-core - sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo + sudo dnf config-manager --add-repo "https://download.docker.com/linux/$ID/docker-ce.repo" sudo dnf install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin elif command -v yum > /dev/null; then # CentOS