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

This commit is contained in:
Solomon Hykes 2013-04-22 22:29:12 -07:00
parent 97badbd29e
commit 82b8f7a565
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,11 @@
# This will build a container capable of producing an official binary build of docker and
# uploading it to S3
from ubuntu:12.10
run apt-get update
run RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q s3cmd
run RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q golang
run RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q git
run RUNLEVEL=1 DEBIAN_FRONTEND=noninteractive apt-get install -y -q build-essential
copy dockerbuilder /usr/local/bin/dockerbuilder
copy s3cfg /.s3cfg
# run $img dockerbuilder $REVISION_OR_TAG $S3_ID $S3_KEY

View File

@ -0,0 +1,29 @@
#!/bin/sh
set -x
set -e
PACKAGE=github.com/dotcloud/docker
if [ $# -lt 3 ]; then
echo "Usage: $0 REVISION AWS_ID AWS_KEY"
exit 1
fi
export REVISION=$1 AWS_ID=$2 AWS_KEY=$3
export PATH=/usr/local/bin:$PATH
mkdir -p /go/src/$PACKAGE
git clone "https://$PACKAGE" /go/src/$PACKAGE
cd /go/src/$PACKAGE
git checkout $REVISION
# FIXME: checkout to specific revision
BUILDDIR=/tmp/docker-$REVISION
mkdir -p $BUILDDIR
(cd docker && go get && go build -o $BUILDDIR/docker)
tar -f /tmp/docker.tgz -C $(dirname $BUILDDIR) -zc $(basename $BUILDDIR)
s3cmd -P put /tmp/docker.tgz s3://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-$REVISION.tgz

3
hack/dockerbuilder/s3cfg Normal file
View File

@ -0,0 +1,3 @@
[default]
access_key = $AWS_ID
secret_key = $AWS_KEY