0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ec2-user に docker コマンド実行権限付与

Last updated at Posted at 2020-10-05

なぜやる

VSCode の Remote Development で EC2 にログイン後、docker コマンド実行できないため、 VSCode プラグインが正常動作しません。

事前準備

dockerなどインストール
# 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/v2.2.3/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

やること

Dockerグループにユーザ追加
sudo usermod -a -G docker ec2-user

最終確認

EC2再起動後確認できます。

docker info
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?