wsl環境にdockerをインストールして、いざpullしようとすると
permission denied while trying to connect to the docker API at unix:///var/run/docker.sock
のエラー
どうゆうこと
調べるとどうも権限がないのが原因らしい
///var/run/docker.sock
ここに今使っているユーザーで権限を上げればいい
今使っているユーザー名が「test01」だとしたら
sudo chown test01 ///var/run/docker.sock
これで権限が与えられたので上手くいきます!!
試しにpullしてみよう
sudo docker pull mysql
Using default tag: latest
latest: Pulling from library/mysql
7a5e1e917526: Pull complete
57bd38a2d740: Pull complete
e4f376e797b1: Pull complete
f6a972aa365b: Pull complete
98d18218e1bb: Pull complete
ac5a3aa7003a: Pull complete
aff72f8f4e98: Pull complete
b843491434c1: Pull complete
ba8d858f8b56: Pull complete
55f85a7d691e: Pull complete
6cb2348819f8: Download complete
a12c35ca5779: Download complete
Digest: sha256:fe036967257bf11aab7184e371920c5b629f0dd36cbefdf4ccd2ae18cc900dbd
Status: Downloaded newer image for mysql:latest
docker.io/library/mysql:latest
成功!!!

コメント