Browse code

hack/dockerbuilder: a standard build environment for building and uploading official binary builds of docker... inside docker

Solomon Hykes authored on 2013/04/23 14:29:12
Showing 3 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,11 @@
0
+# This will build a container capable of producing an official binary build of docker and
1
+# uploading it to S3
2
+from	ubuntu:12.10
3
+run	apt-get update
4
+run	RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q s3cmd
5
+run	RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q golang
6
+run	RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q git
7
+run	RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q build-essential
8
+copy	dockerbuilder	/usr/local/bin/dockerbuilder
9
+copy	s3cfg	/.s3cfg
10
+# run $img dockerbuilder $REVISION_OR_TAG $S3_ID $S3_KEY
0 11
new file mode 100644
... ...
@@ -0,0 +1,29 @@
0
+#!/bin/sh
1
+set -x
2
+set -e
3
+
4
+PACKAGE=github.com/dotcloud/docker
5
+
6
+if [ $# -lt 3 ]; then
7
+	echo "Usage: $0 REVISION AWS_ID AWS_KEY"
8
+	exit 1
9
+fi
10
+
11
+export REVISION=$1 AWS_ID=$2 AWS_KEY=$3
12
+
13
+
14
+export PATH=/usr/local/bin:$PATH
15
+
16
+mkdir -p /go/src/$PACKAGE
17
+git clone "https://$PACKAGE" /go/src/$PACKAGE
18
+cd /go/src/$PACKAGE
19
+git checkout $REVISION
20
+
21
+# FIXME: checkout to specific revision
22
+
23
+BUILDDIR=/tmp/docker-$REVISION
24
+mkdir -p $BUILDDIR
25
+(cd docker && go get && go build -o $BUILDDIR/docker)
26
+
27
+tar -f /tmp/docker.tgz -C $(dirname $BUILDDIR) -zc $(basename $BUILDDIR)
28
+s3cmd -P put /tmp/docker.tgz s3://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-$REVISION.tgz
0 29
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+[default]
1
+access_key = $AWS_ID
2
+secret_key = $AWS_KEY