How to install Docker on CentOS?


// install the required utils
yum install -y yum-utils

// install device mapper
yum install -y device-mapper-persistent-data

// install lvm2
yum install -y lvm2

// add docker repo
yum-config-manager --add-repo

// check the available docker verisons
yum list docker-ce --showduplicates | sort -r

// install the latest version
yum install docker-ce docker-ce-cli

// start docker
systemctl start docker

// check docker status
systemctl status docker

// enable docker start on system restart
systemctl enable docker

// run docker hello-world to check if the installation is sucsessful
docker run hello-world