8

I'm running a virtual machine in Windows Azure with the prebuild image for Ubuntu 14.04 LTS.

When I want to install Docker.io like described here: http://blog.docker.io/2014/04/docker-in-ubuntu-ubuntu-in-docker/

The installation works but when i`m running:

sudo docker.io pull ubuntu 

An error will be thrown:

Cannot connect to the Docker daemon. Is docker -d running on this host?

Can anyone help or has the similar problem?

P.S.: Can anyone with a high reputation create a Tag for Ubuntu-14.04?

6 Answers 6

6

Evidently the docker daemon is not running. You wanna check /etc/default/docker.conf for proper configuration and issue

sudo service docker.io start

or

sudo service docker start

depending on how they called the service

4
  • Thanks service is up and running but now I get the next error: dial unix /var/run/docker.sock: permission denied Apr 19, 2014 at 13:44
  • OK I think that is not config related or so!! github.com/dotcloud/docker/issues/5314 Apr 19, 2014 at 14:28
  • 3
    OK usermod -a -G docker {{your_user}} fixed it for now Apr 19, 2014 at 15:11
  • service docker restart worked for me instead of start.
    – grepit
    Sep 5, 2014 at 0:10
6

Adding myself to the docker group:

sudo usermod -a -G docker myuser

and rebooting the machine worked for me. This solution is discussed in: https://github.com/docker/docker/issues/5314

0
4

On Ubuntu 14.04, the docker.io package installs Docker 0.9.1.

According to the documentation, to install the current version use these commands:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
$ sudo apt-get update
$ sudo apt-get install lxc-docker

There is also a simple script available to help with this process:

$ curl -s https://get.docker.io/ubuntu/ | sudo sh

Alternatively, check the azure-docker-registry project for an example of how to automate Azure provisioning and Docker container deployment. For instance, this Ansible playbook:

- name: create docker data directory
  file: path=/mnt/data/docker state=directory

- name: store docker files in data disk
  file: src=/mnt/data/docker dest=/var/lib/docker state=link

- name: add repository key
  command: creates=/etc/apt/sources.list.d/docker.list apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9

- name: copy repository source file
  copy: src=docker.list dest=/etc/apt/sources.list.d/docker.list

- name: install docker package
  apt: name=lxc-docker update_cache=yes state=present
1

Also make sure to symlink the docker.io binary to docker to use the tutorials/documentation without rewriting every command.

ln -s /usr/bin/docker.io /usr/bin/docker
1

Run docker -d to see if it shows any error messages.

If apparmor is missing install it with sudo apt-get install apparmor

Then sudo service docker start

0

Hard to say but sometime official docker installation procedure fails on Ubuntu 14.04. One can simply install docker using below given commands [Quick and Dirty]

sudo apt-get update
sudo apt-get -y install docker.io

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.