14

I have installed docker in Linux Mint 17 Qiana (which is based on Ubuntu 14.04) present in the Oracle VM. If I tries to start, it shows the following error,

FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS? 

I couldn't find any useful information regarding this when I tried googling regarding the same. This stackoverflow question suggesting to restart my system, but it doesn't work.

I'm seeing the following related questions which are unhelpful.

/var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

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

So, any help on this would be greatly helpful.

Community
  • 1
  • 1
Stranger
  • 10,332
  • 18
  • 78
  • 115
  • Duplicate of [Am I trying to connect to a TLS-enabled daemon without TLS?](http://stackoverflow.com/questions/27528337/am-i-trying-to-connect-to-a-tls-enabled-daemon-without-tls) – Piotr Dobrogost May 20 '16 at 20:16

1 Answers1

30

I don't know how it comes with .deb package (I'm using Fedora), but TLS shouldn't be set by default, so I would suggest following some basic steps to see if it is running correctly.

1. Check if docker daemon is running

ps aux | grep docker
root      4215  0.1  0.1 440156 17332 ?        Ssl  15:48   0:00 /usr/bin/docker -d -D --bip=172.17.42.1/16 --dns=172.17.42.1 --dns-search=docker -s overlay
wololock  8986  0.0  0.0 113024  2304 pts/1    S+   15:50   0:00 /usr/bin/grep docker

I the docker process is not running, try sudo /etc/init.d/docker start or sudo service docker start

2. Check if /var/run/docker.sock exists

ls -la /var/run/docker.*
-rw-r--r--. 1 root root   4 04-23 15:48 /var/run/docker.pid
srw-rw----. 1 root docker 0 04-23 15:48 /var/run/docker.sock

The important part here is that file need to be own by group docker, so you can connect to it without root permissions.

If docker.sock does not exist, you can try running docker from the command line with debug mode on to see what causes the problem:

sudo docker -d -D

3. Check if your user is added to docker group

id -a
uid=1000(wololock) gid=1000(wololock) grupy=1000(wololock),0(root),10(wheel),100(users),977(docker),989(pkg-build)

If you wont find your user in docker group, try adding yourself to it by:

sudo gpasswd -a [username] docker

4. Get the latest docker version

If the previous attempts wont help, try getting the latest docker version from https://docs.docker.com/installation/ubuntulinux/#installing-docker-on-ubuntu I'm not sure, but this line:

FATA[0000] Get http:///var/run/docker.sock/v1.18/containers/json:

suggests that you're using docker v1.18. I might be wrong, but if it's true, this is not the most recent docker version and it should be upgraded. I use currently docker v1.5.0, it works well on Fedora 21

IMPORTANT: UBUNTU / LINUX MINT USERS

The problem we discussed here was caused by missing (or not running) apparmor package in the ubuntu/linuxmint distribution. The easiest way to fix it is to install apparmor:

sudo apt-get install apparmor

If it's installed yet not running, start it with:

sudo service apparmor start

I hope my answer will help you in resolving your problem. If you have any questions, feel free to ask. I will try to help you as much as I can.

Szymon Stepniak
  • 40,216
  • 10
  • 104
  • 131
  • Hi, % symbol in front of every command throws error. Is that the one you intended to type? – Stranger Apr 23 '15 at 14:05
  • No no, my bad. It's my prompt symbol. I will remove it so it does not confuse anyone. :) – Szymon Stepniak Apr 23 '15 at 14:06
  • The second one shows, "ls: cannot access /var/run/docker.*: No such file or directory". Should i create? – Stranger Apr 23 '15 at 14:08
  • It says, that your docker daemon is not running correctly. Try `sudo docker -d -D` to run is as a daemon (-d option) with debug mode enabled (-D option). It should say what is the problem, we can continue from that point. – Szymon Stepniak Apr 23 '15 at 14:15
  • `sudo docker -d -D` returns with the error `FATA[0000] Shutting down daemon due to errors: Error loading docker apparmor profile: fork/exec /sbin/apparmor_parser: no such file or directory ()` at the end. – Stranger Apr 23 '15 at 14:18
  • Check this one - http://stackoverflow.com/a/29796836/2194470 Sid had similar problem with apparmor, in his case installing/starting the apparmor daemon helped. – Szymon Stepniak Apr 23 '15 at 14:22
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/76073/discussion-between-udhayakumar-and-szymon-stepniak). – Stranger Apr 23 '15 at 14:23