Update June 2019
What a dogs dinner. Unfortunately, the other answers didn't work for me.
For the most part, the official docker instructions for installing using a repository DID work.
sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
Followed by:
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
However, I had to modify the next command as follows (adding --nobest):
sudo yum install docker-ce --nobest
Finally, check the docker client:
docker --version
Docker version 18.09.7, build 2d0083d
Note also, the above works for standard RHEL AMI on AWS, but not for the Amazon Linux AMI type. May also find referencing this github issue insightful.
Added bonus, I found the following additional commands helpful:
Start the docker daemon:
sudo systemctl start docker.service
Give the current user (in my case ec2-user
- check with whoami
) rights to the docker group. This avoids running everything with sudo.
sudo usermod -aG docker $USER
Now, logoff and login again as same user as before (in my case ec2-user
).
At this point, everything should be working. Check the docker daemon:
docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE