Ícaro Bichir bio photo

Ícaro Bichir

Geek that dreams to be a hacker, became a intern security, a DevOps Analyst and now, SysAdmin with DevOps Engineering thinking. ;)

Email LinkedIn Github Last.fm

General Vision

If you are having problem with Docker, receiving this following error when initiate a new docker:

time="2015-06-10T17:24:26-03:00" level=fatal msg="Error response from daemon: 
Cannot start container 16e1b3fabf3c9d9c9383f9ab59fef558417bb61020dbbb19b947540af6999b78:
Error getting container 16e1b3fabf3c9d9c9383f9ab59fef558417bb61020dbbb19b947540af6999b78 from driver devicemapper: 
Error mounting '/dev/mapper/docker-202:1-531040-16e1b3fabf3c9d9c9383f9ab59fef558417bb61020dbbb19b947540af6999b78' 
on '/var/lib/docker/devicemapper/mnt/16e1b3fabf3c9d9c9383f9ab59fef558417bb61020dbbb19b947540af6999b78': no such file or directory" 

Check the Docker and Udev syncronization.

$ docker info | grep Udev
Udev Sync Supported: false

Docker is meant to be built statically as it tries to contain everything it needs in the binary. If the return is false, your Docker is running statically and we need to work on that.

Check if docker is running dynamically with the following command:

$ ldd /usr/bin/docker
not a dynamic executable

Catch all the versions of Docker running in your system and remove then.

$ dpkg-query -l *docker*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                              Version               Architecture          Description
+++-=================================-=====================-=====================-=======================================================================
ii  docker                            1.5-1                 amd64                 System tray for KDE3/GNOME2 docklet applications

$ sudo apt-get remove docker
$ sudo apt-get autoremove

###Dependencies

(running ubuntu-trusty-64 14.04.2 LTS)

Let’s begin by installing the regular Docker package:

sudo apt-get install -qy apt-transport-https
sudo apt-get install golang build-essential libdevmapper-dev golang-gosqlite-dev
sudo apt-get install uuid-dev libattr1-dev zlib1g-dev libacl1-dev e2fslibs-dev libblkid-dev liblzo2-dev
sudo apt-get install asciidoc xmlto --no-install-recommends

BTRFS_BUILD VERSION should be set before install dependencies.

If not, set correct version.

$ #first check if your version is Btrfs v3.18.2
$ 
$ fgrep BTRFS_BUILD_VERSION btrfs-progs2/version.h
$ fgrep BTRFS_BUILD_VERSION version.h

Install dependencies for BTRFS driver.

$ git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/mason/btrfs-progs
$ cd btrfs-progs/
$ ./autogen.sh
$ ./configure
$ make
$ sudo make install

Build Docker

$ git clone https://[email protected]/docker/docker
$ cd docker/
$ #Checkout on the last stable version
$ git branch release-v1.6.2
$ git checkout release-v1.6.2
$ git checkout v1.6.2
$ AUTO_GOPATH=1 ./hack/make.sh dynbinary

Installation

$ sudo install -m 755 -o root -g root docker-1.6.2 /usr/bin/docker-1.6.2
$ sudo install -m 755 -o root -g root dockerinit-1.6.2 /usr/bin/dockerinit-1.6.2
$ cd /usr/bin/
$ sudo ln -s docker-1.6.2 docker
$ sudo ln -s dockerinit-1.6.2 dockerinit

Check the Docker status and check syncronization with Udev

$ sudo service docker start
$ docker info | grep -i udev
Udev Sync Supported: true
WARNING: No swap limit support
$ docker version
Client version: 1.6.2
Client API version: 1.18
Go version (client): go1.2.1
Git commit (client): 7c8fca2
OS/Arch (client): linux/amd64
Server version: 1.6.2
Server API version: 1.18
Go version (server): go1.2.1
Git commit (server): 7c8fca2
OS/Arch (server): linux/amd64

Now, your Docker is running in accordance with Udev, should not have problems with devicemapper.

###See Ya