Update Docker Package Database. In a terminal window, type:
sudo yum check-update
Remove if any docker is preinstalled with your OS-
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
Install the Dependencies
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
The –y switch indicates to the yum installer to answer “yes” to any prompts that may come up. The yum-utils switch adds the yum-config-manager. Docker uses a device mapper storage driver, and the device-mapper-persistent-data and lvm2 packages are required for it to run correctly.