如何解决无法登录Docker

时间:2017-06-18 05:08:42

标签: docker

按照Docker指南,我尝试使用命令构建Docker

  

sudo gradle build buildDocker

我收到错误:

What went wrong:
Execution failed for task ':buildDocker'.
Docker execution failed
Command line [docker push vw98075/demo-docker-postgresql:0.0.1-SNAPSHOT] returned:
denied: requested access to the resource is denied

根据有关此站点的信息,我首先尝试登录docker并运行该命令。运行“docker login”后,我收到另一个错误:

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.27/auth: dial unix /var/run/docker.sock: connect: permission denied

我跑

  

$ ls -l /var/run/docker.sock

whick yield

srw-rw---- 1 root docker 0 Jun 17 21:47 /var/run/docker.sock

如何解决此问题?

1 个答案:

答案 0 :(得分:0)

您的用户显然不在docker群组中。因此,任何docker命令都需要与sudo一起运行。