Skip to content

Commit

Permalink
fix(kURL): add pre-check to remove docker in AL2 (#5382)
Browse files Browse the repository at this point in the history
  • Loading branch information
DexterYan committed Sep 2, 2024
1 parent ed61d48 commit d8ad88b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions scripts/common/docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,21 @@ function uninstall_docker_new_installs_with_containerd() {
;;

centos|rhel|amzn|ol)
local dockerPackages=("docker.io" "docker-ce" "docker-ce-cli")
local dockerPackages=("docker" "docker.io" "docker-ce" "docker-ce-cli")
if rpm -qa | grep -q 'docker-ce-rootless-extras'; then
dockerPackages+=("docker-ce-rootless-extras")
fi
if rpm -qa | grep -q 'docker-scan-plugin'; then
dockerPackages+=("docker-scan-plugin")
fi
rpm --erase ${dockerPackages[@]}
local installedDockerPackages=()
# Check if each Docker-related package is installed and add to the list if so
for package in "${dockerPackages[@]}"; do
if sudo rpm -q "$package" &>/dev/null; then
installedPackages+=("$package")
fi
done
rpm --erase ${installedPackages[@]}
;;
esac

Expand Down

0 comments on commit d8ad88b

Please sign in to comment.