20

I am running the installation tutorial for Docker on Linux - Ubuntu 14.04

Going step by step through the tutorial, I get the following error message:

docker run hello-world

Post http:///var/run/docker.sock/v1.20/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?
* Is your docker daemon up and running?

The similar question docker error: /var/run/docker.sock: no such file or directory refers to boot2docker which I am not using

Community
  • 1
  • 1
john mangual
  • 7,718
  • 13
  • 56
  • 95
  • @Woot4Moo there is no Docker file -- this is the Hello World tutorial – john mangual Sep 06 '15 at 16:30
  • There most assuredly is one. Or you have a magic tutorial – Woot4Moo Sep 06 '15 at 16:47
  • 2
    This isn't related to a `Dockerfile`. He can't even talk to the daemon yet so anything done to a `Dockerfile` won't help. – Andy Shinn Sep 07 '15 at 02:04
  • Check this question too http://stackoverflow.com/questions/29349112/var-run-docker-sock-no-such-file-or-directory-are-you-trying-to-connect-to-a/29796836#29796836 – SidJ Sep 07 '15 at 02:21
  • What version of Linux are you running 32 or 64 bit? Can you also post the output from the `env` command – booyaa Sep 07 '15 at 12:02

9 Answers9

29

Had the same issue, solved:

docker-machine start default
eval "$(docker-machine env default)"
E-Xor
  • 291
  • 2
  • 3
  • 2
    When I run this commend, I get: `Error: Host does not exist: default` Did anyone else encounter this issue? – frmsaul May 02 '17 at 20:15
  • You've to start the Docker application. Goto Applications and click on Docker (as of now, there is no way to start from terminal). Once the startup is complete, you'll see docker icon in Mac's taskbar. – devsathish Jan 21 '18 at 16:16
11

I got the same problem today. you just have to start the service.

sudo service docker start

It works on linux. I don't know if it works on mac

BoumTAC
  • 3,531
  • 6
  • 32
  • 44
4

I had the same problem running docker on ubuntu 14.04.

Trying running Docker as root: sudo docker run hello-world

Type in password when prompted.

3

Check the ownership of the file /var/run/docker.sock:

ls -l /var/run/docker.sock
srw-rw----. 1 root root 0 Nov 18 16:17 /var/run/docker.sock

Change the group settings to dockerroot:

sudo chown root:dockerroot /var/run/docker.sock

ls -l /var/run/docker.sock
srw-rw----. 1 root dockerroot 0 Nov 18 16:17 /var/run/docker.sock

Then it should work.

Tom Zych
  • 13,329
  • 9
  • 36
  • 53
1

Both the solution here are tried and tested on linux only
Solution 1:
I was Having the same issue, Login with root privilege solved my problem
Solution 2:
The solution here works only with root user because root user has full access to linux socket similarly docker group has full access to linux socket. if you want to run this with non root user you need to add user to docker group, you can do this with following command -

sudo usermod -aG docker $(whoami)

Now logout and login you should be able to work with non-root user :)

Manish Jindal
  • 293
  • 3
  • 11
0

After getting stuck I turned off the computer and went on a road trip. One Monday I turned the computer on and docker run hello-world runs just as the tutorial indicated.

john mangual
  • 7,718
  • 13
  • 56
  • 95
  • 1
    Because Docker was not running. It was installed (along with the init script) and when you rebooted the computer the init script was run. The initial error pointed this out as the very first thing... – Andy Shinn Sep 07 '15 at 16:18
  • This is my first time using docker and really it is only because it is required to install another library called [splash](https://splash.readthedocs.org/en/latest/kernel.html) – john mangual Sep 07 '15 at 17:14
0

Had exactly the same problem on Windows 8.1 Answer was to open the Oracle VM Virtual Box, right click on the default instance and then click on "Show" icon. Then saw BootLocker logo. Then back to the Docker Quickstarter "> whale" icon, double click and ascii docker appears.

Anoyz
  • 7,431
  • 3
  • 30
  • 35
0

In linux, after installation, though docker version was giving a proper output, docker run hello-world was not working because the service was not up.

I tried service docker restart in SLES 12 SP3 Linux machine. It worked. So probably your docker daemon needs a restart.

Try the same command service docker restart and it should work.

Jaydeep Ranipa
  • 421
  • 5
  • 16
-2

So, is the Docker daemon running? What troubleshooting did you already do?

The tutorial doesn't mention starting Docker or adding yourself to the docker group so that you can run Docker command without sudo (although, this should have been mentioned when you installed Docker). You need to do both of these things first.

Andy Shinn
  • 26,561
  • 8
  • 75
  • 93
  • 1
    If the docker daemon were running or not, I wouldn't know. No troubleshooting as I expected Docker to work out of the box. – john mangual Sep 07 '15 at 12:00
  • You can find out using `/etc/init.d/docker status` – booyaa Sep 07 '15 at 12:03
  • My point was that the message you got back, quite literally, asked if the daemon was running and you seemingly chose to ignore that. The very first Google search result for the message brings you to https://github.com/docker/docker/issues/15620 which explains the problem and how to resolve it. – Andy Shinn Sep 07 '15 at 16:21