Last active
December 31, 2015 01:39
-
-
Save wking/7915716 to your computer and use it in GitHub Desktop.
Docker on Debian Wheezy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enabled “wheezy main” and “wheezy-updates main” in | |
/etc/apt/sources.list, commented out the CD. | |
From http://backports.debian.org/Instructions/ | |
# echo 'deb http://ftp.debian.org/debian/ wheezy-backports main' > /etc/apt/sources.list.d/backports.list | |
# apt-get update | |
# apt-get install lxc iptables bridge-utils libdevmapper-dev golang git mercurial gcc libsqlite3-dev | |
To get a more recent kernel (>3.8 recommended by Docker): | |
# apt-get install -t wheezy-backports linux-image-amd64 linux-headers-amd64 | |
# CONFIG=/boot/config-3.11.0.bpo.2-amd64 lxc-checkconfig | |
Install Go v1.1+: | |
# mkdir ~/src | |
# cd ~/src | |
# wget http://go.googlecode.com/files/go1.2.linux-amd64.tar.gz | |
# tar -C /usr/local -xvf go1.2.linux-amd64.tar.gz | |
# cat <<EOF >> /etc/profile.d/go.sh | |
> export GOROOT="/usr/local/go" | |
> export GOPATH="/usr/local/lib/go" | |
> FIRST_PATH=$(echo "\${PATH}" | sed 's/:.*//') | |
> if [ "\${FIRST_PATH}" != "\${GOROOT}/bin" ]; then | |
> export PATH="\${GOROOT}/bin:\${GOPATH}/bin:\${PATH}" | |
> fi | |
> EOF | |
(use `su -` to make sure you get /etc/profile sourced) | |
Install Docker: | |
# mkdir -p $GOPATH/src/github.com/dotcloud | |
# cd $GOPATH/src/github.com/dotcloud | |
# git clone https://github.com/dotcloud/docker.git | |
# cd docker | |
# git checkout v0.7.1 | |
# go get -v github.com/dotcloud/docker/... | |
Run it: | |
# docker -d | |
Network goes down… Move bridge so it doesn't conflict with the VPN: | |
# ip addr del 172.17.42.1/16 dev docker0 | |
# ip addr add 172.31.42.1/16 dev docker0 | |
Then: | |
# docker -d | |
[/var/lib/docker|441c8a4b] +job initapi() | |
[/var/lib/docker|441c8a4b.initapi()] Creating server | |
Could not locate dockerinit: This usually means docker was built incorrectly. See http://docs.docker.io/en/latest/contributing/devenvironment for official build instructions.[/var/lib/docker|441c8a4b] -job initapi() = ERR (1) | |
2013/12/11 12:57:54 initapi: Could not locate dockerinit: This usually means docker was built incorrectly. See http://docs.docker.io/en/latest/contributing/devenvironment for official build instructions. | |
https://github.com/dotcloud/docker/issues/636 | |
Rebuild: | |
# cd /usr/local/lib/go/src/github.com/dotcloud/docker/ | |
# ./hack/make.sh dynbinary | |
# cp -p bundles/0.7.1/dynbinary/docker-0.7.1 $GOPATH/bin/docker | |
# cp -p bundles/0.7.1/dynbinary/dockerinit-0.7.1 $GOPATH/bin/dockerinit | |
Then: | |
# docker -d | |
[/var/lib/docker|84ac22ea] +job initapi() | |
[/var/lib/docker|84ac22ea.initapi()] Creating server | |
Loading containers: done. | |
2013/12/11 13:06:29 WARNING: cgroup mountpoint not found for memory | |
2013/12/11 13:06:29 WARNING: IPv4 forwarding is disabled. | |
[/var/lib/docker|84ac22ea.initapi()] Creating pidfile | |
… | |
# docker fetch ubuntu | |
# docker run -i -t ubuntu /bin/bash | |
WARNING: IPv4 forwarding is disabled. | |
lxc-start: No cgroup mounted on the system | |
lxc-start: failed to spawn '6ecf3d6b23716b3af2e55f36796ad7877d7820a61f8bf0ae215667cb0092600e' | |
[error] commands.go:2420 Error getting size: bad file descriptor | |
# echo net.ipv4.ip_forward = 1 > /etc/sysctl.d/docker.conf | |
# sysctl net.ipv4.ip_forward=1 | |
# docker -d | |
[/var/lib/docker|78f642b0] +job initapi() | |
[/var/lib/docker|78f642b0.initapi()] Creating server | |
Loading containers: done. | |
2013/12/11 14:01:42 WARNING: cgroup mountpoint not found for memory | |
[/var/lib/docker|78f642b0.initapi()] Creating pidfile | |
[/var/lib/docker|78f642b0.initapi()] Setting up signal traps | |
… | |
https://github.com/dotcloud/docker/issues/431 | |
# echo none /sys/fs/cgroup cgroup defaults 0 0 >> /etc/fstab | |
# mount /sys/fs/cgroup | |
Also: | |
https://gist.github.com/datagrok/5785876 | |
http://docs.docker.io/en/latest/installation/ubuntulinux/ | |
https://www.digitalocean.com/community/articles/how-to-install-docker-on-ubuntu-13-04-x64-vps | |
http://golang.org/doc/go1.1#gocmd | |
https://code.google.com/p/go/issues/detail?id=6164 | |
(go.net/ipv6: build fails on linux, need Go v1.2 (tip)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment