Install Docker on Debian

Snipet to build a Linux kernel with AUFS support.


apt-get -y install git build-essential libncurses5-dev

git clone git:// linux.git
pushd linux.git
git checkout -b v$VERSION tags/v$VERSION

git clone git:// aufs3-standalone.git
pushd aufs3-standalone.git
git checkout -b aufs$VERSION remotes/origin/aufs$VERSION

pushd linux.git
patch -p1  < ../aufs3-standalone.git/aufs3-kbuild.patch
patch -p1  < ../aufs3-standalone.git/aufs3-base.patch
patch -p1  < ../aufs3-standalone.git/aufs3-mmap.patch
patch -p1  < ../aufs3-standalone.git/aufs3-standalone.patch

cp -r ../aufs3-standalone.git/Documentation .
cp -r ../aufs3-standalone.git/fs .
cp -r ../aufs3-standalone.git/include/uapi/linux/aufs_type.h include/uapi/linux/

At this point we must configure the Kernel. Keep in mind that CGroup is activated and AUFS Filesystem:

pushd linux.git
make menuconfig
make all -j8
mkdir ../kernel-$VERSION
cp ./arch/x86_64/boot/bzImage ../kernel-$VERSION/

The next step is to boot with this kernel:

cp ../kernel-3.12/bzImage /boot/bzImage-3.14.6-64
cp ../kernel-3.12/ /boot/

#Generating grub.cfg ...
#Found linux image: /boot/bzImage-3.14.6-64
#Found Debian GNU/Linux (7.2) on /dev/sda1


Install docker:

echo "deb docker main" > /etc/apt/sources.list.d/docker.list
wget -qO- | apt-key add -
apt-get update
apt-get -y install lxc-docker

Check if the enviroment setup is compatible with lxc:

--- Namespaces ---
 Namespaces: enabled
 Utsname namespace: enabled
 Ipc namespace: enabled
 Pid namespace: enabled
 User namespace: enabled
 Network namespace: enabled
 Multiple /dev/pts instances: enabled
--- Control groups ---
 Cgroup: enabled
 Cgroup clone_children flag: enabled
 Cgroup device: enabled
 Cgroup sched: enabled
 Cgroup cpu account: enabled
 Cgroup memory controller: missing
 Cgroup cpuset: enabled
--- Misc ---
 Veth pair device: enabled
 Macvlan: enabled
 Vlan: enabled
 File capabilities: enabled
Note : Before booting a new kernel, you can check its configuration
 usage : CONFIG=/path/to/config /usr/bin/lxc-checkconfig

Add the current user to docker group

adduser $USER docker

To verify the installation run the following command:

docker run -i -t ubuntu /bin/bash

now you are in a ubuntu-docked shell 🙂

Useful urls:

This entry was posted in Debian, General, Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *