Skip to content
Advertisement

Docker fails at first run after install. Error Post http://….. permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?

I’m following step one of this docker tutorial. I have installed ubuntu version 14.04 on a virtual box vm. I intentionally downgraded by docker version so that when I type “docker version” I get Client version: 1.5.0. This is because the server I intend to communicate with is on 1.5.0.

When trying the command “docker run hello-world” I get the response:

"Post http:///var/run/docker.sock/v1.17/containers/create: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?"

When running “sudo docker run hello-world” I get the response:

Cannot connect to the Docker daemon. Is 'docker -d' running on this host?

Can someone please explain to me what’s happening and how can fix it? Thanks.

Edit: I tried to follow the solution for Linux here

However,

I had tried to follow El Mesa’s instructions in that post. However, when I got to running sudo docker -d I got an Error running DeviceCreate (createPool) dm_task_run failed. I don’t think I need to start up a anything since I was just following the tutorial and the tutorial just did docker run hello-world immediately after installing docker

Advertisement

Answer

It may be that your docker daemon is not running.

I have ubuntu/docker on a desktop with wireless LAN.

It acts a bit finicky compared to the wired computers from which docker works OK, and duplicates the error message you reported:

$ docker run -it ubuntu:latest /bin/bash
FATA[0000] Post http:///var/run/docker.sock/v1.17/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 

However, after running:

sudo service docker start

It behaves correctly (at least until the host is rebooted):

$ docker run -it ubuntu:latest /bin/bash
root@2cea4e5f5028:/# 

If the system is not starting the docker daemon on boot, as was the case here, then the docker daemon can be automatically started on boot by editing /etc/rc.local to do so. Add the line below immediately before the exit line. This will fork a new bash shell, wait 30 sec for the network setup, etc., to settle, and start the docker daemon. sudo is unnecessary here because /etc/rc.local runs as root.

( sleep 30; /usr/sbin/service docker start ) &
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement