Am I trying to connect to a TLS-enabled daemon without TLS?

前端 未结 20 2329
暗喜
暗喜 2020-11-28 17:56

I\'m trying to learn about Docker, but I keep getting cryptic (to me) error messages.

Possibly the simplest example of this is trying to print the version of Docker

20条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-28 18:36

    I faced the same issue when I was creating Docker images from Jenkins. Simply add the user to the docker group and then restart Docker services and in my case I had to restart Jenkins services.

    This was the error which I got:

    http:///var/run/docker.sock/v1.19/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=59aec062a8dd8b579ee1b61b299e1d9d340a1340: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
    FATAL: Failed to build docker image from project Dockerfile
    java.lang.RuntimeException: Failed to build docker image from project Dockerfile
    
    Solution:
    
    [root@Jenkins ssh]# groupadd docker
    [root@Jenkins ssh]# gpasswd -a jenkins docker
    Adding user jenkins to group docker
    [root@Jenkins ssh]# /etc/init.d/docker restart
    Stopping docker:                                           [  OK  ]
    Starting docker:                                           [  OK  ]
    [root@Jenkins ssh]# /etc/init.d/jenkins restart
    Shutting down Jenkins                                      [  OK  ]
    Starting Jenkins                                           [  OK  ]
    [root@Jenkins ssh]#
    

提交回复
热议问题