After a few recent issues with using docker on Amazon Linux, I am no longer recommending it. I believe these are related to the devicemapper storage backend and perhaps more steps now need to be performed. Maybe it will be fine if you set it up with overlayFS.
sudo yum update -y
sudo yum install docker-io -y
Optional - Add ec2-user to Docker Group
sudo usermod -a -G docker ec2-user
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites. More info.