X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/3738c5ed84aeaf6da98bd46e2ce69574411eb520..346a55897f4e4a2a26a1a84665f860c000b3da7d:/docker/build.sh diff --git a/docker/build.sh b/docker/build.sh index 6edebb9d7a..77aeb1f187 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,9 +1,41 @@ -#! /bin/sh +#! /bin/bash -# build the base wheezy image, if it doesn't already exist -(docker images | grep '^arvados/debian') || \ - ./mkimage-debootstrap.sh arvados/debian wheezy http://debian.lcs.mit.edu/debian/ +# make sure a Ruby version greater than or equal to 1.9.3 is installed before proceeding +if ! ruby -e 'exit RUBY_VERSION >= "1.9.3"' 2>/dev/null +then + echo "Building the Arvados docker containers requires at least Ruby 1.9.3." + echo "Please install ruby 1.9.3 or higher before executing this script." + exit 1 +fi -# build the Docker images -docker build -rm -t arvados/base base -docker build -rm -t arvados/api api +function usage { + echo >&2 + echo >&2 "usage: $0 [options]" + echo >&2 + echo >&2 "Calling $0 without arguments will build all Arvados docker images" + echo >&2 + echo >&2 "$0 options:" + echo >&2 " -h, --help Print this help text" + echo >&2 " clean Clear all build information" + echo >&2 " realclean clean and remove all Arvados Docker images except arvados/debian" + echo >&2 " deepclean realclean and remove arvados/debian, crosbymichael/skydns and " + echo >&2 " crosbymichael/skydns Docker images" + echo >&2 +} + +if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then + usage + exit 1 +fi + +build_tools/build.rb + +if [[ "$?" == "0" ]]; then + DOCKER=`which docker.io` + + if [[ "$DOCKER" == "" ]]; then + DOCKER=`which docker` + fi + + DOCKER=$DOCKER /usr/bin/make -f build_tools/Makefile $* +fi