diff --git a/contrib/install.sh b/contrib/install.sh index 04340e2acb..3cf7169a07 100755 --- a/contrib/install.sh +++ b/contrib/install.sh @@ -35,10 +35,10 @@ else fi fi -echo "Downloading docker binary and uncompressing into /usr/local/bin..." -curl -s https://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-latest.tgz | -tar -C /usr/local/bin --strip-components=1 -zxf- \ -docker-latest/docker +echo "Downloading docker binary to /usr/local/bin..." +curl -s https://get.docker.io/builds/$(uname -s)/$(uname -m)/docker-latest \ + > /usr/local/bin/docker +chmod +x /usr/local/bin/docker if [ -f /etc/init/dockerd.conf ] then @@ -50,7 +50,7 @@ description "Docker daemon" start on filesystem or runlevel [2345] stop on runlevel [!2345] respawn -exec env LANG="en_US.UTF-8" /usr/local/bin/docker -d +exec /usr/local/bin/docker -d EOF fi diff --git a/make.sh b/make.sh index 0e2e63bb0a..06bc2f0203 100755 --- a/make.sh +++ b/make.sh @@ -51,6 +51,16 @@ Docker is a great building block for automating distributed systems: large-scale web deployments, database clusters, continuous deployment systems, private PaaS, service-oriented architectures, etc." +UPSTART_SCRIPT='description "Docker daemon" + +start on filesystem or runlevel [2345] +stop on runlevel [!2345] + +respawn + +exec docker -d +' + # Each "bundle" is a different type of build artefact: static binary, Ubuntu # package, etc. @@ -86,16 +96,7 @@ bundle_ubuntu() { # Generate an upstart config file (ubuntu-specific) mkdir -p $DIR/etc/init - cat > $DIR/etc/init/docker.conf < $DIR/etc/init/docker.conf # Copy the binary mkdir -p $DIR/usr/bin diff --git a/release.sh b/release.sh index f4047cc172..4237070de4 100755 --- a/release.sh +++ b/release.sh @@ -48,12 +48,14 @@ BUCKET=$AWS_S3_BUCKET setup_s3() { # Try creating the bucket. Ignore errors (it might already exist). - s3cmd --acl-public mb s3://$BUCKET 2>/dev/null || true + s3cmd mb s3://$BUCKET 2>/dev/null || true # Check access to the bucket. # s3cmd has no useful exit status, so we cannot check that. # Instead, we check if it outputs anything on standard output. # (When there are problems, it uses standard error instead.) s3cmd info s3://$BUCKET | grep -q . + # Make the bucket accessible through website endpoints. + s3cmd ws-create --ws-index index --ws-error error s3://$BUCKET } # write_to_s3 uploads the contents of standard input to the specified S3 url. @@ -152,10 +154,23 @@ EOF fi } +# Upload the index script +release_index() { + ( + if [ "$BUCKET" != "get.docker.io" ] + then + sed s,https://get.docker.io/,http://$BUCKET.s3.amazonaws.com/, contrib/install.sh + else + cat contrib/install.sh + fi + ) | write_to_s3 s3://$BUCKET/index +} + main() { setup_s3 release_binary release_ubuntu + release_index } main