1 all: api-image doc-image workbench-image warehouse-image sso-image
3 # `make clean' removes the files generated in the build directory
4 # but does not remove any docker images generated in previous builds
6 -rm *-image */generated/*
9 # `make realclean' will also remove the docker images and force
10 # subsequent makes to build the entire chain from the ground up
12 -[ -n "`docker ps -q`" ] && docker stop `docker ps -q`
13 -docker rm `docker ps -a -q`
14 -docker rmi `docker images -q`
16 # ============================================================
17 # Dependencies for */generated files which are prerequisites
18 # for building docker images.
20 BASE_DEPS = base/Dockerfile $(BASE_GENERATED)
22 API_DEPS = api/Dockerfile $(API_GENERATED)
24 DOC_DEPS = doc/Dockerfile doc/apache2_vhost
26 WORKBENCH_DEPS = workbench/Dockerfile \
27 workbench/passenger.conf \
28 $(WORKBENCH_GENERATED)
30 WAREHOUSE_DEPS = warehouse/Dockerfile \
31 warehouse/supervisor.conf \
32 $(WAREHOUSE_GENERATED)
34 SSO_DEPS = sso/passenger.conf $(SSO_GENERATED)
36 BASE_GENERATED = base/generated
39 api/generated/apache2_vhost \
40 api/generated/config_databases.sh \
41 api/generated/database.yml \
42 api/generated/omniauth.rb \
43 api/generated/production.rb \
44 api/generated/secret_token.rb \
45 api/generated/superuser_token
48 api/apache2_vhost.in \
49 api/config_databases.sh.in \
52 api/production.rb.in \
53 api/secret_token.rb.in \
54 api/superuser_token.in
56 WORKBENCH_GENERATED = \
57 workbench/generated/apache2_vhost \
58 workbench/generated/production.rb \
59 workbench/generated/secret_token.rb
61 WORKBENCH_GENERATED_IN = \
62 workbench/apache2_vhost.in \
63 workbench/production.rb.in \
64 workbench/secret_token.rb.in
66 WAREHOUSE_GENERATED = warehouse/generated/warehouse.conf
68 WAREHOUSE_GENERATED_IN = warehouse/warehouse.conf.in
71 sso/generated/apache2_vhost \
72 sso/generated/seeds.rb \
73 sso/generated/secret_token.rb
76 sso/apache2_vhost.in \
78 sso/secret_token.rb.in
80 $(BASE_GENERATED): config.yml
83 $(API_GENERATED): config.yml $(API_GENERATED_IN)
86 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
89 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
92 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
95 # ============================================================
96 # The main Arvados servers: api, doc, workbench, warehouse
98 api-image: passenger-image $(API_DEPS)
99 mkdir -p api/generated
100 tar -c -z -f api/generated/api.tar.gz -C ../services api
101 docker build -t arvados/api api
102 echo -n "Built at $(date)" > api-image
104 doc-image: base-image $(DOC_DEPS)
105 mkdir -p doc/generated
106 tar -c -z -f doc/generated/doc.tar.gz -C .. doc
107 docker build -t arvados/doc doc
108 echo -n "Built at $(date)" > doc-image
110 workbench-image: passenger-image $(WORKBENCH_DEPS)
111 mkdir -p workbench/generated
112 tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench
113 docker build -t arvados/workbench workbench
114 echo -n "Built at $(date)" > workbench-image
116 warehouse-image: base-image $(WAREHOUSE_DEPS)
117 docker build -t arvados/warehouse warehouse
118 echo -n "Built at $(date)" > warehouse-image
120 sso-image: passenger-image $(SSO_DEPS)
121 docker build -t arvados/sso sso
122 echo -n "Built at $(date)" > sso-image
124 # ============================================================
125 # The arvados/base image is the base Debian image plus packages
126 # that are dependencies for every Arvados service.
128 passenger-image: base-image
129 docker build -t arvados/passenger passenger
130 echo -n "Built at $(date)" > passenger-image
132 base-image: debian-image $(BASE_DEPS)
133 docker build -t arvados/base base
134 echo -n "Built at $(date)" > base-image
137 ./mkimage-debootstrap.sh arvados/debian wheezy http://debian.lcs.mit.edu/debian/
138 echo -n "Built at $(date)" > debian-image