Skip to content

Instantly share code, notes, and snippets.

@gongzili456
Created September 29, 2017 06:31
Show Gist options
  • Save gongzili456/007878c96f954dd5ea913954d31f5635 to your computer and use it in GitHub Desktop.
Save gongzili456/007878c96f954dd5ea913954d31f5635 to your computer and use it in GitHub Desktop.
To get Docker running on the AWS AMI you should follow the steps below (these are all assuming you have ssh'd on to the EC2 instance).
Update the packages on your instance
[ec2-user ~]$ sudo yum update -y
Install Docker
[ec2-user ~]$ sudo yum install docker -y
Start the Docker Service
[ec2-user ~]$ sudo service docker start
Add the ec2-user to the docker group so you can execute Docker commands without using sudo.
[ec2-user ~]$ sudo usermod -a -G docker ec2-user
You should then be able to run all of the docker commands without requiring sudo. After running the 4th command I did need to logout and log back in for the change to take effect.
@gongzili456
Copy link
Author

To get Docker running on the AWS AMI you should follow the steps below (these are all assuming you have ssh'd on to the EC2 instance).

Update the packages on your instance

[ec2-user ~]$ sudo yum update -y
Install Docker

[ec2-user ~]$ sudo yum install docker -y
Start the Docker Service

[ec2-user ~]$ sudo service docker start
Add the ec2-user to the docker group so you can execute Docker commands without using sudo.

[ec2-user ~]$ sudo usermod -a -G docker ec2-user
You should then be able to run all of the docker commands without requiring sudo. After running the 4th command I did need to logout and log back in for the change to take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment