I started up a ubuntu virtual machine using vagrant. The version of Ubuntu running is 12.04 precise. I installed docker using the package method outlined on the docker website: Docker version 1.13.0, build 49bf474.
I added docker to upstart, and am able to start and stop docker through the upstart commands:
$ sudo service docker stop
docker stop/waiting
$ sudo service docker start
docker start/running, process 22994
I then try running the command:
$ sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
I've looked through the numerous articles on stack overflow, but most of them deal with user permissions. At this point, I wouldn't mind having to put in 'sudo' if I can just get it to run.
Cannot connect to docker daemon pointed me to an attempt to unset the 'DOCKER_HOST' value. I attemtped this with no luck. I tried the 5th answer from Docker command can't connect to Docker daemon, where it's mentioned that this is a network issue, but again with no luck. I tried the 6th answer with adding the docker key, again with no luck.
Does anyone have any ideas of where else I can look as to why I'm getting this error?
EDIT:
When I run $ sudo service docker stauts, I get docker start/running, process {pId}. What's strange is that every time I run it, pId is different.
~$ sudo service docker status
docker start/running, process 28630
~$ sudo service docker status
docker start/running, process 28881
~$ sudo service docker status
docker start/running, process 29007
EDIT 2:
I found Docker can't connect to docker daemon where one answer recommended running debug mode. Unfortunately, running
sudo docker --debug
Kept throwing the standard 'help' error where it did not recognize the flag. I also tried '-d' (per the answer) and '-D' (per the help file) with the same response.
Just looking into things, I tried ps.
$ ps aux | grep docker
root 18776 0.0 3.5 87904 13328 ? Ssl 20:51 0:00 /usr/bin/dockerd --raw-logs
root 18785 0.0 1.2 59860 4808 ? Ssl 20:51 0:00 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc vagrant 18792 0.0 0.2 11676 948 pts/0 R+ 20:51 0:00 grep --color=auto docker
but has the odd behaviour that everytime I run it, the pId changes.