按照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
如何解决此问题?
答案 0 :(得分:0)
您的用户显然不在docker
群组中。因此,任何docker命令都需要与sudo
一起运行。