From 8b487823da0facc3fbb911a03ef95533f17a9039 Mon Sep 17 00:00:00 2001 From: Brian Zalewski Date: Wed, 25 Jan 2023 13:18:43 +0000 Subject: [PATCH] Update file run_onchange_before_11-install-docker.tmpl --- .../run_onchange_before_11-install-docker.tmpl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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