File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ DOCKER_VERSION=24.0.7
66DOCKER=" ${DOCKER:= 0} "
77USE_APT=0
88USE_DNF=0
9+ DISTRO=" Unassigned"
910
1011if [ " $EUID " -ne 0 ]; then
1112 printf " Please run this script as root or sudo\n"
@@ -23,10 +24,16 @@ os_check() {
2324 case $ID in
2425 ubuntu)
2526 USE_APT=1
27+ DISTRO=" ubuntu"
2628 ;;
27- fedora | rocky )
29+ fedora)
2830 USE_DNF=1
29- ;;&
31+ DISTRO=" fedora"
32+ ;;
33+ rocky)
34+ USE_DNF=1
35+ DISTRO=" rhel"
36+ ;;
3037 * ) ;;
3138 esac
3239}
@@ -79,18 +86,18 @@ docker_install() {
7986 apt install --no-install-recommends -y ca-certificates gnupg
8087 install -m 0755 -d /etc/apt/keyrings
8188 curl_check
82- curl -fsSL https://download.docker.com/linux/ubuntu /gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
89+ curl -fsSL https://download.docker.com/linux/" $DISTRO " /gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
8390 chmod a+r /etc/apt/keyrings/docker.gpg
8491 # shellcheck disable=SC1091
8592 echo \
86- " deb [arch=$( dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
93+ " deb [arch=$( dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/" $DISTRO " \
8794 $( . /etc/os-release && echo " $VERSION_CODENAME " ) stable" |
8895 tee /etc/apt/sources.list.d/docker.list > /dev/null
8996 apt update
9097 apt install --no-install-recommends -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
9198 elif [ $USE_DNF -eq 1 ]; then
9299 dnf -y install dnf-plugins-core
93- dnf config-manager --add-repo https://download.docker.com/linux/fedora /docker-ce.repo
100+ dnf config-manager --add-repo https://download.docker.com/linux/" $DISTRO " /docker-ce.repo
94101 dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
95102 systemctl start docker
96103 else
You can’t perform that action at this time.
0 commit comments