Grant docker command execution permission to ec2-user

Why do

After logging in to EC2 with Remote Development in VSCode, the VSCode plug-in does not work properly because the docker command cannot be executed.

Advance preparation

Install docker etc.


# install docker
sudo amazon-linux-extras install -y docker

# auto start docker service
sudo systemctl enable docker
sudo systemctl start docker

# install docker-compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

things to do

Add user to Docker group


sudo usermod -a -G docker ec2-user

final confirmation

** You can check after restarting EC2. ** **

docker info

Recommended Posts

Grant docker command execution permission to ec2-user
Docker command
Try to use docker command without sudo.
Memorandum docker command
Docker command list
Docker command memo
docker basic command
Command to stop or delete all Docker resources
Docker command summary
Docker command memorandum
[Docker] Command summary
[Docker] Command list
Easy setup to run docker command without sudo (Linux)
Command memo to install xeyes in ubuntu docker environment
Command to try using Docker for the time being
Docker Machine command memo
How to install Docker
Introduction to javadoc command
Introduction to jar command
docker error delete command
docker command personal summary
Introduction to java command
Docker command cheat sheet
Introduction to javac command