Installing Docker.io on Ubuntu 14.04LTS

16,743

Solution 1

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

Solution 2

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

Solution 3

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

Solution 4

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

Solution 5

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

Share:
16,743
lkoenigsberger
Author by

lkoenigsberger

Certified IT Systems Manager from Germany

Updated on July 07, 2022

Comments

  • lkoenigsberger
    lkoenigsberger almost 2 years

    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?

  • lkoenigsberger
    lkoenigsberger about 10 years
    Thanks service is up and running but now I get the next error: dial unix /var/run/docker.sock: permission denied
  • lkoenigsberger
    lkoenigsberger about 10 years
    OK I think that is not config related or so!! github.com/dotcloud/docker/issues/5314
  • lkoenigsberger
    lkoenigsberger about 10 years
    OK usermod -a -G docker {{your_user}} fixed it for now
  • grepit
    grepit over 9 years
    service docker restart worked for me instead of start.