# First add repo to yum config manager
sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
# Use added repo to install and start docker
sudo yum install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
# Optional: Validate by run sample image
sudo docker run hello-world
sudo yum install -y yum-utils
$ sudo yum-config-manager
--add-repo
https://download.docker.com/linux/centos/docker-ce.repo
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
#Makes docker to auto-start
sudo chkconfig docker on
#Installs git
sudo yum install -y git
#Reboots the system
sudo reboot