Connect to your workspace. Update the installed packages and package cache on your workspace.
$ sudo yum update -y
Install the most recent Docker Community Edition package.
$ sudo amazon-linux-extras install docker
Start the Docker service.
$ sudo service docker start
Add the current user to the docker group so you can execute Docker commands without using sudo.
$ sudo usermod -a -G docker ec2-user
or
$ ll /var/run-/docker.sock
srw-rw----. 1 root root 0 Mar 22 16:40 /var/run/docker.sock
$ sudo chgrp docker /var/run/docker.sock
$ sudo usermod -aG docker ${USER}
$ sudo ll /var/run/docker.sock
srw-rw----. 1 root docker 0 Mar 22 16:40 /var/run/docker.sock
$ su - ${USER}
Verify that the ec2-user can run Docker commands without sudo.
$ docker info
$ sudo yum update -y
Install the most recent Docker Community Edition package.
$ sudo amazon-linux-extras install docker
Start the Docker service.
$ sudo service docker start
Add the current user to the docker group so you can execute Docker commands without using sudo.
$ sudo usermod -a -G docker ec2-user
or
$ ll /var/run-/docker.sock
srw-rw----. 1 root root 0 Mar 22 16:40 /var/run/docker.sock
$ sudo chgrp docker /var/run/docker.sock
$ sudo usermod -aG docker ${USER}
$ sudo ll /var/run/docker.sock
srw-rw----. 1 root docker 0 Mar 22 16:40 /var/run/docker.sock
$ su - ${USER}
Verify that the ec2-user can run Docker commands without sudo.
$ docker info
Comments
Post a Comment