Docker: Are you trying to connect to a TLS-enabled daemon without TLS?

前端 未结 12 1359
时光说笑
时光说笑 2021-01-31 07:47

On Linux Mint 17.1 x86_64 with kernel 3.13.0-48-generic and OpenSSL version 1.0.1f-1ubuntu2.11; whenever I try to execute any docker command (like docker login or <

相关标签:
12条回答
  • 2021-01-31 08:17

    This can happen when the docker service is unable to start. sudo service docker start or restart returning no output does not mean that it started successfully. You can use sudo /etc/init.d/docker status to find out if, and why, it failed to start.

    In my case, it was due to lack of disk space.

    username@computer:~$ sudo service docker restart
    username@computer:~$ sudo /etc/init.d/docker status
    ? docker.service - Docker Application Container Engine
       Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
       Active: failed (Result: start-limit) since Mon 2015-12-21 15:11:59 PST; 21s ago
         Docs: http://docs.docker.com
      Process: 26463 ExecStart=/usr/bin/docker -d -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
     Main PID: 26463 (code=exited, status=1/FAILURE)
    
    Dec 21 15:11:59 computer docker[26463]: time="2015-12-21T15:11:59-08:00" level=info msg="Listening for HTTP on fd ()"
    Dec 21 15:11:59 computer docker[26463]: time="2015-12-21T15:11:59-08:00" level=info msg="+job init_networkdriver()"
    Dec 21 15:11:59 computer docker[26463]: time="2015-12-21T15:11:59-08:00" level=info msg="-job init_networkdriver() = OK (0)"
    Dec 21 15:11:59 computer docker[26463]: time="2015-12-21T15:11:59-08:00" level=fatal msg="Shutting down daemon due to errors: Insertion failed because database is full: database or disk is full"
    Dec 21 15:11:59 computer systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE
    Dec 21 15:11:59 computer systemd[1]: Unit docker.service entered failed state.
    Dec 21 15:11:59 computer systemd[1]: docker.service failed.
    Dec 21 15:11:59 computer systemd[1]: start request repeated too quickly for docker.service
    Dec 21 15:11:59 computer systemd[1]: Failed to start Docker Application Container Engine.
    Dec 21 15:11:59 computer systemd[1]: docker.service failed.
    

    After deleting some files, I was able to restart the service and run docker containers normally.

    0 讨论(0)
  • 2021-01-31 08:18

    In my case it was because of file /Users/user/.ssh/config has permissions 777. To check it run in terminal ssh docker@localhost

    0 讨论(0)
  • 2021-01-31 08:18

    Ran into the same problem after following the steps at https://docs.docker.com/linux/step_one/. docker service was running and I had also added the user to docker group. docker commands were not working without sudo.

    What solved it for me was restarting the PC. Note- Before PC restart, I had also tried stopping and starting the docker daemon. I'm on Ubuntu 12.04.

    0 讨论(0)
  • 2021-01-31 08:18
    sudo chmod 777 /var/run/docker.sock
    
    0 讨论(0)
  • 2021-01-31 08:22

    I deployed docker on CentOS 7, and my friend first helped me check whether the process/service docker is actually running or not. He used the command ps -ef | grep docker. It turned out that the process wasn't running at all. Finally, he started this process by using the command service docker start. In the end, the problem was solved.

    0 讨论(0)
  • 2021-01-31 08:25

    I faced the same issue when I was creating docker image from Jenkins simply add the user to docker group and then restart docker services and in my case I have 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]#
    
    0 讨论(0)
提交回复
热议问题