Docker install on Debian 7 Wheezy

Docker requirement for Debian

Docker is using the LXC – Linux Containers heavily.
Due to the lack of LXC on Debian 7 a newer Linux kernel is required.

I don’t advice installing a backported kernel on production. But I didn’t notice any bug on my personal Debian

This tutorial was made from Debian 7.4 and installed Docker 0.8

I – Install backport Kernel

First make sure you log as root and run the commands:

sh -c "echo deb wheezy-backports main > /etc/apt/sources.list.d/wheezy-backports.list"
apt-get update -y
apt-get -t wheezy-backports install linux-image-amd64 -y

It will reboot your Debian on a new Kernel.

II – Install Docker

apt-key adv --keyserver --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
sh -c "echo deb docker main > /etc/apt/sources.list.d/docker.list"
apt-get update -y
apt-get install lxc-docker-0.8.0 -y

Docker is now install with all it dependancies.

III – First VM with Docker

It’s time to create our first Virtual Machine. Let’s try with a CentOS VM.
Download (or Pull) the CentOS container and start it.

docker pull centos
docker run -i -t centos /bin/bash

If everything went smoothly, this command should confirm you’re indeed running in a CentOS VM.

tail /etc/redhat-release

CentOS RedHat (TODO)

  • shayneo

    missing step
    2) take shower to wash off slime (Essential psychological step for debian folks finding centos on their machine)

    :P (Just kidding)

  • shayneo

    I recomend adding any user who wants to use docker to the docker group

    sudo adduser shayneo docker , for instance would be the command that adds me to the docker group. I just log out, and log in, and it seems to work. A bit safer than operating in root.

  • syndrael

    It doesn’t work on my Wheezy 7.8
    Can you help me ?

    > apt-get update -y

    Ign docker/main Translation-en_US
    Ign docker/main Translation-en
    Ign docker/main Translation-fr

    > apt-get install lxc-docker-0.8.0 -y
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    E: Unable to locate package lxc-docker-0.8.0
    E: Couldn’t find any package by regex ‘lxc-docker-0.8.0′

    Thanks a lot.
    Best regards