X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d34013c865b896c605ad503a7c1f15e6ce84cc32..63e8f77e963949d4187555411e7b5c60fc850468:/docker/build.sh diff --git a/docker/build.sh b/docker/build.sh old mode 100755 new mode 100644 index baef0e8309..6478f814a9 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,24 +1,42 @@ -#! /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/ +build_ok=true -# build the Docker images -docker build -t arvados/base base +# Check that: +# * IP forwarding is enabled in the kernel. -mkdir -p api/generated -tar -c -z -f api/generated/api.tar.gz -C ../services api -docker build -t arvados/api api +if [ "$(/sbin/sysctl --values net.ipv4.ip_forward)" != "1" ] +then + echo >&2 "WARNING: IP forwarding must be enabled in the kernel." + echo >&2 "Try: sudo sysctl net.ipv4.ip_forward=1" + build_ok=false +fi -mkdir -p docserver/generated -tar -c -z -f docserver/generated/doc.tar.gz -C .. doc -docker build -t arvados/docserver docserver +# * Docker can be found in the user's path +# * The user is in the docker group +# * cgroup is mounted +# * the docker daemon is running -mkdir -p workbench/generated -tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench -docker build -t arvados/workbench workbench +if ! docker images > /dev/null 2>&1 +then + echo >&2 "WARNING: docker could not be run." + echo >&2 "Please make sure that:" + echo >&2 " * You have permission to read and write /var/run/docker.sock" + echo >&2 " * a 'cgroup' volume is mounted on your machine" + echo >&2 " * the docker daemon is running" + build_ok=false +fi -mkdir -p warehouse/generated -tar -c -z -f warehouse/generated/warehouse.tar.gz -C ../.. warehouse-apps -docker build -t arvados/warehouse warehouse +# * config.yml exists +if [ '!' -f config.yml ] +then + echo >&2 "WARNING: no config.yml found in the current directory" + echo >&2 "Copy config.yml.example to config.yml and update it with settings for your site." + build_ok=false +fi + +# If ok to build, then go ahead and run make +if $build_ok +then + make $* +fi