Install Docker on CentOS 8 – Automatically!

Docker doesn’t come with “stock” repos on CentOS, some variations of alias programs are installations like podman.

These lack many of the core commands of the “real” Docker.

Here is a guide to install Docker Latest Version on CentOS.

yum clean all -y
yum update -y
yum upgrade -y

dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo

DOCKERVERSION=$(dnf list docker-ce --showduplicates | \
sort -r | \
grep "docker-ce.x86_64" -m1 | \
sed -e 's/docker\-ce\.x86\_64//g' -e 's/docker\-ce\-stable//g' | \
tr -d [:space:])

# if the above fails, try the latest compatible via
dnf install docker-ce-$DOCKERVERSION -y

Leave a Reply

Your email address will not be published. Required fields are marked *