Cannot connect to docker daemon (RHEL 6.5)

I have installed docker on RHEL 6.
I’m having trouble running docker commands

[abc@localhost ~]$ sudo service docker start
Starting docker: [ OK ]
[abc@localhost ~]$ sudo docker run hello-world
Cannot connect to the Docker daemon. Is ‘docker -d’ running on this host?
[abc@localhost ~]$ sudo docker images
Cannot connect to the Docker daemon. Is ‘docker -d’ running on this host?

I think I have a problem with the server side connections

[abc@localhost ~]$ docker version
Client version: 1.7.1
Client API version: 1.19
Go version (client): go1.4.2
Git commit (client): 786b29d
OS/Arch (client): linux/amd64
Get http:///var/run/docker.sock/v1.19/version: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?

How can I fix this ?

1 Like

Hi is this a brand new install ?

can you run “echo $DOCKER_HOST” and paste here?

1 Like

It doesn’t print anything. Just a blank line.

[abc@localhost ~]$ echo $DOCKER_HOST

[abc@localhost ~]$

1 Like

is this a new install or has anything changed with the

etc/default/docker file ?

can you paste that file here

a reboot would not hurt , I know the docker service is running but I am not sure there is not some dependency that might not have

1 Like

Yes. This is a new install.

I’m not able to find the docker file under etc/default.
Under etc/default, I found only 2 files: nss, and useradd


Also, the docker failed stopping while restart.

[abc@localhost default]$ sudo service docker restart
Stopping docker: [FAILED]
Starting docker: [ OK ]

please type cd to /etc/default and run

“sudo ls -la”

1 Like

or that would be

change directory to /etc/default

and run “sudo ls -la”

1 Like

the problem is I have all my dockers running on ubuntu so I am not sure how much help I can be , If i get the time I will get it on RHEL 6 and see what happens

or do you want to spin up an unbuntu images and start the install again ?

1 Like

what is the exact version of RHEL are you using ?

I have a few different ISOs here I can build one with

1 Like

Docker is supported on the following versions of RHEL:

Red Hat Enterprise Linux 7
Red Hat Enterprise Linux 6.6 or later

1 Like

[abc@localhost default]$ sudo ls -la
[sudo] password for abc:
total 24
drwxr-xr-x. 2 root root 4096 Jul 19 05:33 .
drwxr-xr-x. 103 root root 12288 Jul 23 08:36 …
-rw-r–r--. 1 root root 1756 Nov 5 2013 nss
-rw-------. 1 root root 119 Nov 20 2009 useradd

I’m using RHEL 6.5.

1 Like

using these instructions

https://docs.docker.com/installation/rhel/

1 Like

that might be the issue , it is not supported

however I am spinning up a RHEL 6.5 just to see what happens

ubunutu?

we can get this working very quickly

1 Like

Yeah version 6 might be the issue. Thanks. I’ll try RHEL 7.
I need the docker on RedHat. So, can’t use ubuntu

1 Like

when I do a uname -r on my new RHEL 6.5 install

I get Kernal version 2.6.32-431.el6.x86_64

this will not work

Docker requires a 64-bit installation regardless of your Red Hat version.
Docker requires that your kernel must be 3.10 at minimum. Red Hat 7 runs
the 3.10 kernel, 6.6 does not. We make an exception for Red Hat 6.6. To run
Docker on Red Hat-6.6 http://www.centos.org/or later, you need kernel
2.6.32-431 or higher.

To check your current kernel version, open a terminal and use uname -r to
display your kernel version:

$ uname -r

1 Like

I am at lunch. Please let me know how it goes

1 Like

I don’t have access to RHEL workstation 7.
Instead of this, which version of CenOS can I use ?

1 Like

I have a similar problem except with Kali Linux:
I have spent a few days on it.

Debugging as following:

printf “\n\nDocker Debug Command\n\n” ; ls -latr /etc/default /etc/default/docker | tail -5 ; uname -r ; docker version ; echo $DOCKER_HOST ; service docker start ; sleep 1 ; service docker status ; sudo docker run hello-world ; docker -d

copy and paste:

printf "\n\nDocker Debug Command\n\n" ; ls -latr /etc/default /etc/default/docker | tail -5 ; uname -r ; docker version ; echo $DOCKER_HOST ; service docker start ; sleep 1 ; service docker status ; sudo docker run hello-world ; docker -d

-rw-r–r-- 1 root root 493 Jul 25 21:04 docker
-rw-r–r-- 1 root root 17 Jul 27 11:34 locale
-rw-r–r-- 1 root root 620 Jul 27 11:34 rcS
drwxr-xr-x 3 root root 120 Jul 27 18:19 .
drwxr-xr-x 201 root root 900 Jul 27 19:37 …
3.18.0-kali3-amd64
Client:
Version: 1.8.0-dev
API version: 1.20
Go version: go1.4.2
Git commit: a2ea8f2
Built: Sat Jul 25 21:35:51 UTC 2015
OS/Arch: linux/amd64
Experimental: true
Cannot connect to the Docker daemon. Is ‘docker -d’ running on this host?
tcp://127.0.0.1:2375
[ ok ] Starting Docker: docker.
[FAIL] Docker is not running … failed!
Cannot connect to the Docker daemon. Is ‘docker -d’ running on this host?
Warning: ‘-d’ is deprecated, it will be removed soon. See usage.
WARN[0000] please use ‘docker daemon’ instead.
WARN[0000] Running experimental build
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
ERRO[0000] [graphdriver] prior storage driver “devicemapper” failed: EOF
FATA[0000] Error starting daemon: error initializing graphdriver: EOF

I have tried installing via all varient repo’s but no success.
This is a fresh install so the recent updates which use docker to update do not help me.

Any suggestions are welcome. -Rob

i made some progress on this with the following command:

xterm docker -d -D -g $PWD/docker -p $PWD/docker.pid &

still checking…

I’m using centOs now. I have read somewhere that centOs already has docker downloaded in repositories. So, I tried installing, and I get this message:

Cannot find valid base url for repo: base/7/x86_64

How can I fix this ?