It is a standard method of installing Docker on Amazon Linux EC2
- Update packages
sudo yum update -y
- Install Docker
sudo yum install -y
- Start the Docker service
sudo service docker start
or
sudo systemctl start docker
- Enable
docker
server start on system startup.
sudo systemctl enable docker
- Verify that docker is installed correctly by running the hello-world image.
sudo docker run hello-world
NOTE:
- If you are not using
root
user no need to usesudo
in front of commads. - In realtime envirnoment we are not install docker in
Amazon linux
we had separate containerization services called Amazon Elastic Container Registry (ECR), Amazon Elastic Container Service (ECS), Amazon Elastic Kubernetes Service (EKS) and so on.