Skip to content

Instantly share code, notes, and snippets.

@alvarlaigna
Created March 28, 2014 14:11
Show Gist options
  • Save alvarlaigna/9833751 to your computer and use it in GitHub Desktop.
Save alvarlaigna/9833751 to your computer and use it in GitHub Desktop.
echo "Don't naively execute this file as a shell script. I didn't add error-handling"
echo "or anything like that. Execute all the commands by hand at the command line."
echo
echo "FIXME: this process is currently broken, see note in source code below."
exit 1
# In testing, we don't need to mess with unstable kernels any longer; 3.10 is in testing.
# That 3.10 kernel from testing has also been backported to wheezy; in wheezy-backports.
#
# This should mean debian stable (+backports) has everything you need to run docker,
# except for that bleeding-edge version of golang. (See below)
sudo apt-get update
sudo apt-get install lxc wget bsdtar curl golang git aufs-tools mercurial iptables libdevmapper-dev
# set up environment variables (also add these to your .profile to make them sticky)
export GOPATH=~/usr/lib/go/
export PATH=$GOPATH/bin:$PATH
mkdir -p "$GOPATH"
# use go to install docker
# FAIL: wheezy's golang is go1.0.2. jessie's is go1.1.2. Whoever is responsible
# for https://code.google.com/p/go/source/browse/?repo=net hasn't tagged it
# properly so that the correct versions of the source code needed for the
# following "go get" command is downloaded. I don't know golang well enough to
# fix or work around this myself. Oh and to complicate matters, docker now
# "vendors" go source code as well. (copy-pastes files from some unknown point
# in history)
#
# I really hope docker is doing some advanced crazy computational golang-only
# shit because if not they could have implemented in python and been usable on
# lots more platforms a long time ago.
#
go get -v github.com/dotcloud/docker/...
# this will squelch ipv6 errors on jessie, but i don't know if it breaks anything else...
rm -rf $GOPATH/src/github.com/dotcloud/docker/vendor/src/code.google.com/p/go.net/ipv6
go install -v github.com/dotcloud/docker/...
# this will successfully build a docker binary, but aparrently it doesn't do it through
# the makefiles in "hack/" which conspire to get a SHA1 checksum into the docker binary,
# that it uses to verify the "dockerinit" executable is the right one to use when it
# discovers where it lives. (And when the SHA1 is not in the binary, the resulting error
# message upon trying to run docker is "can't find dockerinit" which is totally wrong...
# set up and mount the cgroup mountpoint
echo 'none /sys/fs/cgroup cgroup defaults 0 0' | sudo tee -a /etc/fstab
mount /sys/fs/cgroup
# download the base 'ubuntu' container and run bash inside it while setting up an interactive shell
docker run -i -t ubuntu /bin/bash
# The above errors with: "dial unix /var/run/docker.sock: no such file or directory"
#
# Trying to launch the docker daemon first with:
# sudo PATH=~/usr/lib/go/bin:/sbin:$PATH GOPATH=~/usr/lib/go ~/usr/lib/go/bin/docker -g ~/var/lib/docker -d
# Gives:
# [/home/mike/var/lib/docker|b704a13e] +job initapi()
# [/home/mike/var/lib/docker|b704a13e.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.[/home/mike/var/lib/docker|b704a13e] # -job initapi() = ERR (1)
# 2013/12/06 13:54:56 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.
# type 'exit' to exit the bash shell running in the container.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment