Installing Docker on Ubuntu Quick Fix

I was installing Docker on Ubuntu (14.04.1 LTS) in my home lab for the first time following the instructions at http://docs.docker.com/installation/ubuntulinux/ this evening and came across an issue.

Docker would not start and was showing the following error:

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


Checking processes I don’t see docker running:

$ ps -ef | grep docker
alex      3703  2113  0 21:27 pts/0    00:00:00 grep --color=auto docker


Trying to start docker generated the following errors in /var/log/syslog:

kernel: [  608.236848] init: docker main process ended, respawning
kernel: [  608.451873] init: docker main process (4230) terminated with status 1
kernel: [  608.451906] init: docker main process ended, respawning
kernel: [  608.676417] init: docker main process (4280) terminated with status 1
kernel: [  608.676445] init: docker respawning too fast, stopped


After trying a bunch of different fixes which didn’t work, then looked up the docker log at /var/log/upstart/docker.log, which displayed the following:

Error loading docker apparmor profile: fork/exec/sbin/apparmor_parser: no such file or directory ()


A quick install of apparmor fixed this!

$ sudo apt-get install apparmor


And now…

$ ps -ef | grep docker
root      4577     1  0 21:44 ?        00:00:00 /usr/bin/docker -d
alex      4608  2574  0 21:45 pts/0    00:00:00 grep --color=auto docker
$ sudo docker info
Containers: 0
Images: 0
Storage Driver: devicemapper
 Pool Name: docker-8:1-156936-pool
 Pool Blocksize: 64 Kb
 Data file: /var/lib/docker/devicemapper/devicemapper/data
 Metadata file: /var/lib/docker/devicemapper/devicemapper/metadata
 Data Space Used: 291.5 Mb
 Data Space Total: 102400.0 Mb
 Metadata Space Used: 0.7 Mb
 Metadata Space Total: 2048.0 Mb
Execution Driver: native-0.2
Kernel Version: 3.13.0-35-generic
Operating System: Ubuntu 14.04.1 LTS


Happy Days! I hope this saves others some time!

If you found this post useful, check out my Docker HOWTO series – the first post is here:
http://tekhead.it/blog/2014/09/docker-part-1-introduction-and-howto-install-docker-on-ubuntu-14-04-lts/

Docker , , , , ,