DNF or Dandified YUM is the next-generation version of the Yellowdog Updater Modified (yum), a package manager for .rpm-based Linux distributions.

# Installs security updates and bug fixes for already installed packages. 
# It generally maintains the current version of your packages.
sudo dnf update
sudo dnf --refresh update
# By default, dnf caches repository metadata (information about available packages) 
# for a certain period to improve performance. 
# --refresh bypasses this cache and retrieves the latest information from the repositories.

# In addition to security updates, it might also upgrade packages 
# to newer versions if available. 
# Upgrading can introduce new features or functionality 
# but might also have compatibility issues.
sudo dnf upgrade

Install Docker With DNF

# Add the Docker repository
sudo dnf config-manager --add-repo <https://download.docker.com/linux/centos/docker-ce.repo>

# Install Docker Engine
sudo dnf install --assumeyes --quiet docker-ce docker-ce-cli containerd.io docker-compose-plugin

Start and enable Docker

sudo systemctl start docker
sudo systemctl enable docker

The output from sudo systemctl enable docker

Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/docker.service.

indicates that:

Check Docker version

docker version

Permission Error

The following error message means your user account doesn't have permission to access the Docker daemon (the background process that manages Docker).

permission denied while trying to connect to the Docker daemon socket 
at unix:///var/run/docker.sock: 
Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.45/version": 
dial unix /var/run/docker.sock: connect: permission denied