Add 'build/' from commit '555b039609a3c8700c27767c255fdfe00eb42063'
[arvados.git] / build / install / easy-docker-install.sh
1 #!/usr/bin/env bash
2
3 # This script is intended to make Arvados installation easy. It will download the
4 # latest copy of the Arvados docker images as well as the arvdock command. It
5 # then uses arvdock to spin up Arvados on this computer.
6 #
7 # The latest version of this script is available at http://get.arvados.org, so that this
8 # command does the right thing:
9 #
10 #  $ \curl -sSL http://get.arvados.org | bash
11 #
12 # Prerequisites: working docker installation. Run this script as a user who is a member 
13 # of the docker group.
14
15 COLUMNS=80
16
17 fail () {
18     title "$*"
19     exit 1
20 }
21
22 title () {
23   printf "\n%*s\n\n" $(((${#title}+$COLUMNS)/2)) "********** $1 **********"
24 }
25
26 docker_pull () {
27   $DOCKER pull $*
28
29   ECODE=$?
30
31   if [[ "$ECODE" != "0" ]]; then
32     title "$DOCKER pull $* failed"
33     exit $ECODE
34   fi
35 }
36
37 main () {
38
39   \which which >/dev/null 2>&1 || fail "Error: could not find 'which' command."
40
41   # find the docker binary
42   DOCKER=`which docker.io`
43   
44   if [[ "$DOCKER" == "" ]]; then
45     DOCKER=`which docker`
46   fi
47
48   if [[ "$DOCKER" == "" ]]; then
49     fail "Error: you need to have docker installed. Could not find the docker executable."
50   fi
51
52   echo
53   echo "If necessary, this command will download the latest Arvados docker images."
54   echo "The download can take a long time, depending on the speed of your internet connection."
55   echo "When the images are downloaded, it will then start an Arvados environment on this computer."
56   echo
57   docker_pull arvados/workbench
58   docker_pull arvados/doc
59   docker_pull arvados/keep
60   docker_pull arvados/shell
61   docker_pull arvados/sso
62   docker_pull arvados/compute
63   docker_pull arvados/keep
64   docker_pull arvados/keepproxy
65   docker_pull arvados/api
66   docker_pull crosbymichael/skydns
67   docker_pull crosbymichael/skydock
68
69   # Now download arvdock and start the containers
70   echo
71   echo Downloading arvdock
72   echo
73   \curl -sSL https://raw.githubusercontent.com/curoverse/arvados/master/docker/arvdock -o arvdock
74   chmod 755 arvdock
75
76   echo
77   echo Starting the docker containers
78   echo
79   ./arvdock start
80
81   echo To stop the containers, run
82   echo
83   echo ./arvdock stop
84   echo 
85 }
86
87 main