progrium/buildstep — pull request #9 by shykes (2013-06-24 01:45:26+00:00)
Title: Take advantage of 'docker build' and 'docker pull' to automate building and sharing the base container.

This creates a Dockerfile with all the necessary steps to build the base container using 'docker build', and distributing it via the regular docker index instead of a home-made S3 system.

After a change, the container can be re-built with the following command:

```bash
$ docker build -t progrium/buildstep .
```

Thanks to caching, re-building is extremely fast. Here is the result of re-building after changing the builder script itself: 500ms.

```bash
# time docker build -t progrium/buildstep .
Uploading context 133120 bytes
Step 1 : FROM ubuntu:quantal
---> b750fe79269d
Step 2 : RUN apt-get update
---> Using cache
---> 3e11a97c3f82
Step 3 : RUN apt-get install -y --force-yes bind9-host dnsutils daemontools openssh-server openssh-client netcat-openbsd iputils-tracepath curl ed curl git telnet socat mercurial libssl0.9.8 imagemagick
---> Using cache
---> fcd90166fa78
Step 4 : RUN apt-get install -y --force-yes mysql-client libmysqlclient-dev postgresql postgresql-server-dev-9.1 libsqlite-dev sqlite3
---> Using cache
---> 89c8def401c6
Step 5 : RUN apt-get install -y --force-yes build-essential autoconf bison libevent-dev libglib2.0-dev libjpeg-dev libpq-dev libssl-dev libxml2-dev libxslt-dev zlib1g-dev graphicsmagick-libmagick-dev-compat
---> Using cache
---> 47fa2d08ce66
Step 6 : RUN apt-get install -y --force-yes openjdk-6-jdk
---> Using cache
---> d673b9534b18
Step 7 : RUN apt-get install -y --force-yes openjdk-6-jre-headless
---> Using cache
---> f1950fae4953
Step 8 : RUN apt-get install -y --force-yes nodejs
---> Using cache
---> fac90dc850dd
Step 9 : RUN apt-get install -y --force-yes python-dev
---> Using cache
---> 8e65756f9388
Step 10 : RUN apt-get install -y --force-yes ruby1.9.1-dev rubygems
---> Using cache
---> c13310955585
Step 11 : RUN git clone https://github.com/heroku/heroku-buildpack-ruby /build/buildpacks/heroku-buildpack-ruby
---> Using cache
---> db851861538f
Step 12 : RUN git clone https://github.com/heroku/heroku-buildpack-nodejs /build/buildpacks/heroku-buildpack-nodejs
---> Using cache
---> 28f392b6bd67
Step 13 : RUN git clone https://github.com/heroku/heroku-buildpack-java /build/buildpacks/heroku-buildpack-java
---> Using cache
---> 7753e7867b66
Step 14 : RUN git clone https://github.com/heroku/heroku-buildpack-play /build/buildpacks/heroku-buildpack-play
---> Using cache
---> e2a75868ba73
Step 15 : RUN git clone https://github.com/heroku/heroku-buildpack-python /build/buildpacks/heroku-buildpack-python
---> Using cache
---> 283d69a06f94
Step 16 : RUN git clone https://github.com/heroku/heroku-buildpack-php /build/buildpacks/heroku-buildpack-php
---> Using cache
---> ac3fb1326c55
Step 17 : RUN git clone https://github.com/kr/heroku-buildpack-go /build/buildpacks/heroku-buildpack-go
---> Using cache
---> 0c28afc085a3
Step 18 : RUN git clone https://github.com/miyagawa/heroku-buildpack-perl /build/buildpacks/heroku-buildpack-perl
---> Using cache
---> 303ea6421f9a
Step 19 : RUN update-alternatives --set ruby /usr/bin/ruby1.9.1
---> Using cache
---> c0ec4e1e267b
Step 20 : RUN update-alternatives --set gem /usr/bin/gem1.9.1
---> Using cache
---> 913b3bc71ec2
Step 21 : RUN gem install bundler
---> Using cache
---> 8e489d64700c
Step 22 : RUN cd /build/buildpacks/heroku-buildpack-ruby && bundle install
---> Using cache
---> 49baed1ad04e
Step 23 : CMD ["/build/builder"]
---> Using cache
---> 76475abd6c84
Successfully built 76475abd6c84

real	0m0.598s
user	0m0.024s
sys	0m0.004s
```