sahandha / SparkClusterKubernetes

0 stars 0 forks source link

cannot connect to Docker Daemon #1

Closed sahandha closed 8 years ago

sahandha commented 8 years ago

When setting up a new VM with docker, I install docker. I then create a group docker and add the $USER to it because I encountered the problem before and this was the solution. However, when setting up the VM I get the warning Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon. Is the docker daemon running on this host?). Using system default: https://index.docker.io/v1/, and the following docker commands don't run. If I ssh into that VM, I can easily run these commands.

sahandha commented 8 years ago

The problem seems to be that I took out the command newgrp. See man pages for newgrp. This is needed so that the group changes to the newly created group. The problem though is that if I put this in, then the operations stop, and it gives me a prompt.

sahandha commented 8 years ago

Maybe I can source ~/.profile.

sahandha commented 8 years ago

or use newgrp -l docker to simulate a full login.

sahandha commented 8 years ago

newgrp -l docker did not work.

sahandha commented 8 years ago

Need to use sudo sg docker -c "docker pull sahandha/ubuntu:14.04". This essentially does what newgrp does, but with the option -c. The command in the quotes will be run this case.