mirror of https://github.com/docker/docs.git
hack/dockerbuilder: a standard build environment for building and uploading official binary builds of docker... inside docker
This commit is contained in:
parent
97badbd29e
commit
82b8f7a565
|
@ -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
|
|
@ -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
|
|
@ -0,0 +1,3 @@
|
||||||
|
[default]
|
||||||
|
access_key = $AWS_ID
|
||||||
|
secret_key = $AWS_KEY
|
Loading…
Reference in New Issue