Docker Community Forums

Share and learn in the Docker community.

Failure to start docker on an Amazon linux machine


(2479) #1

Hi, I am using an Amazon linux machine (p2).

I have installed this docker version:

Client:
Version: 17.03.2-ce
API version: 1.27
Go version: go1.7.5
Git commit: 7392c3b/17.03.2-ce
Built: Wed Aug 9 22:45:09 2017
OS/Arch: linux/amd64

I’m not sure, but I think the issue started after killing a screen which ran some docker container

I’m experiencing this error:

sudo docker ps

Gives:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

And:

sudo service docker status

Gives:

docker dead but subsys locked
I have tried both:

sudo rm -rf /var/run/docker
sudo rm /var/run/docker.*

(Sam) #2

how about

sudo service docker stop
sudo service docker start

(2479) #3

It’s stuck after trying:
sudo service docker stop


(Sam) #4

you will probably have to reboot the ec2 instance


(2479) #5

I rebooted the mahcine


(Sam) #6

and the docker ps returns the same error?

if so, then sudo service docker start


(2479) #7

sudo docker ps gives the same error.
sudo service docker start works (but does not print anything)


(Sam) #8

and then docker ps ??

service start command doesn’t usually show anything (for me)


(2479) #9

docker ps gives (sudo service docker start)
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?


(Sam) #10

ok, looks like some known error

use the docker-machine command…


(2479) #11

I don’t see how this helps. I’m using nvidia-docker


(Sam) #12

no idea… you didn’t mention nvidia docker…


(2479) #13

Let us wait for more helpful responses. Thank you


(Sam) #14

may be useful


(2479) #15

It’s a general link which is not relevant.


(David Cardoso) #16

Try:

  1. Check the status:
    $ sudo service docker status
  2. If there isn’t running:
    $ sudo service docker start
  3. And then to auto-start after reboot:
    $ sudo systemctl enable docker
  4. Don’t forget to add your ec2-user to the docker group:
    $ sudo usermod -aG docker ec2-user
  5. And then reboot or just logoff/login again
    $ sudo reboot

bye