Execute the following commands to install docker community edition on Centos 7
You can add the below command to a script file and execute it at once.
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum-config-manager --enable docker-ce-edge
sudo yum-config-manager --enable docker-ce-test
sudo yum makecache fast
sudo yum install docker-ce -y
sudo systemctl start docker