O'Reilly logo

Go Web Development Cookbook by Arpit Aggarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it…

  1. Switch to the root user from the ec2-user user by executing the following command:
[ec2-user@ip-172-31-34-99 ~]$ sudo su[root@ip-172-31-34-99 ec2-user]#
  1. Install Docker and update an EC2 instance by executing the following commands:
[root@ip-172-31-34-99 ec2-user] yum install -y docker[root@ip-172-31-34-99 ec2-user] yum update -y
  1. Start Docker as a service on an EC2 instance by executing the following command:
[root@ip-172-31-34-99 ec2-user] service docker start
  1. Add ec2-user to the docker group so that you can execute Docker commands without using sudo, as follows:
[root@ip-172-31-34-99 ec2-user] usermod -a -G docker ec2-user
  1. Log out of the EC2 instance by executing the following commands:
[root@ip-172-31-34-99 ec2-user]# ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required