I have successfully installed Docker to Ubuntu 16. But to issue commands properly, I am adding
sudo in front of all the docker commands such as
sudo docker pull wordpress. Anyway, the
sudo solved my
Cannot connect to daemon problem. However, I needed to install docker into an ubuntu container, in the same way, I did for the host computer. I have researched and found the following solutions, but they didn't work for the container (I ran
apt-get update before all these):
sudo. Didn't work.
sudo usermod -aG docker <your username>. Didn't work.
sudo usermod -aG docker $USER. Didn't work.
sudo command, though, it was not available in the container. So I had to run
apt-get install sudo. Then,
sudo started working but not docker.
docker command itself works. But, when you make a request via Docker CLI to docker engine, it says it is not connected, or daemon is not working. Also, the default user in the docker ubuntu container is
root. When you enter into the bash TTY, you see
root@[some number]. I am using the following command to install docker:
sudo apt-get install docker.io. I have followed the instructions here to install docker on my host Linux machine:
But what really worked was: