Reputation: 51
I am unable to run Docker on AMI linux EC2 instance on AWS. My AMI linux instance is Linux ip-172-31-29-77 4.14.62-65.117.amzn1.x86_64 #1 SMP Fri Aug 10 20:03:52 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
.
I am able to install docker and start the service using:
sudo yum install -y docker
sudo service docker start
sudo usermod -aG docker ec2-user
but cmd docker ps
does not work?
can anyone help me on this?
Thanks, Nidhi Arora
Upvotes: 4
Views: 3559
Reputation: 167
On Amazon Linux, if you do not know the password of ec2-user, just restart the EC2 instance to refresh the addition of ec2-user to the 'docker' group.
Upvotes: 2
Reputation: 3811
You have done all the steps correctly. I believe your goal here is to run docker commands without sudo.
However after adding user to the docker (Or any) group, you have to refresh the user's group id.
You can either login again or do su - $USER
.
You can run id
before and after to confirm.
Upvotes: 7