Skip to content

Instantly share code, notes, and snippets.

@ubergarm
Created March 21, 2014 20:21
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ubergarm/9695532 to your computer and use it in GitHub Desktop.
Save ubergarm/9695532 to your computer and use it in GitHub Desktop.
DigitalOcean Docker 0.90 w/ cgroups and memory limits working.

DigitalOcean Latest Docker

Spin up a new droplet using stock Ubuntu 12.04.3 LTS

Rough Guide that would make a nice Ansible role:

# update kernel saucy 3.11.0-18-generic
$ apt-get update
$ apt-get purge linux-image-*
$ apt-get install linux-image-generic-lts-saucy linux-headers-generic-lts-saucy

# setup kexec to actually run the kernel you chose w/ the GRUB_CMDLINE options
$ vi /etc/default/grub #GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"

$ vi /etc/init.d/rcS 
#http://ubergarm.github.io/
# if grep -qv ' kexeced$' /proc/cmdline ;then
#    kexec --load /vmlinuz --initrd=/initrd.img --append='root=LABEL=DOROOT cgroup_enable=memory swapaccount=1 kexeced' &&
#    mount -o ro,remount / &&
#    kexec -e
# fi

$ echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/docker.conf
$ apt-get install kexec-tools
$ dpkg-reconfigure kexec-tools #yes/yes

# install docker (despite the old package name, lxc is optional as of 0.90)
# setup ppa then
$ apt-get install lxc-docker cgroup-lite lxc

# libcontainer is default, but im still running lxc for now
$ vi /etc/default/docker #DOCKER_OPTS="-e lxc"
@cdahlhausen
Copy link

This is awesome

@rissem
Copy link

rissem commented Jul 2, 2014

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment