docker:Got permission denied while trying to connect to the Docker

created at 06-07-2022 views: 10

problem

The docker command requires sudo under user privileges otherwise the following problems occur,

Got permission denied while trying to connect to the Docker daemon
socket at unix:///var/run/docker.sock: Post
http://%2Fvar%2Frun%2Fdocker.sock/v1.39/images/create?fromImage=arm64v8%2Fubuntu&tag=18.04:
dial unix /var/run/docker.sock: conne ct: permission denied

solution

The solution to the permission problem encountered when using the docker command:

1. Add docker user group

sudo groupadd docker

2. Add the login user to the docker user group

sudo gpasswd -a $USER docker

3. Update user group

newgrp docker
created at:06-07-2022
edited at: 06-07-2022: