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 CONFIG_RB = build_tools/config.rb
22 BASE_DEPS = base/Dockerfile $(BASE_GENERATED)
24 API_DEPS = api/Dockerfile $(API_GENERATED)
26 DOC_DEPS = doc/Dockerfile doc/apache2_vhost
28 WORKBENCH_DEPS = workbench/Dockerfile \
29 workbench/passenger.conf \
30 $(WORKBENCH_GENERATED)
32 WAREHOUSE_DEPS = warehouse/Dockerfile \
33 warehouse/supervisor.conf \
34 $(WAREHOUSE_GENERATED)
36 SSO_DEPS = sso/passenger.conf $(SSO_GENERATED)
38 BASE_GENERATED = base/generated/arvados.tar.gz
41 api/generated/apache2_vhost \
42 api/generated/config_databases.sh \
43 api/generated/database.yml \
44 api/generated/omniauth.rb \
45 api/generated/production.rb \
46 api/generated/secret_token.rb \
47 api/generated/superuser_token
50 api/apache2_vhost.in \
51 api/config_databases.sh.in \
54 api/production.rb.in \
55 api/secret_token.rb.in \
56 api/superuser_token.in
58 WORKBENCH_GENERATED = \
59 workbench/generated/apache2_vhost \
60 workbench/generated/production.rb \
61 workbench/generated/secret_token.rb
63 WORKBENCH_GENERATED_IN = \
64 workbench/apache2_vhost.in \
65 workbench/production.rb.in \
66 workbench/secret_token.rb.in
68 WAREHOUSE_GENERATED = warehouse/generated/warehouse.conf
70 WAREHOUSE_GENERATED_IN = warehouse/warehouse.conf.in
73 sso/generated/apache2_vhost \
74 sso/generated/seeds.rb \
75 sso/generated/secret_token.rb
78 sso/apache2_vhost.in \
80 sso/secret_token.rb.in
82 $(BASE_GENERATED): config.yml
84 mkdir -p base/generated
85 tar -c -z -f base/generated/arvados.tar.gz -C .. . \
86 --exclude=services/api/log/* --exclude=docker/*
89 $(API_GENERATED): config.yml $(API_GENERATED_IN)
92 $(WORKBENCH_GENERATED): config.yml $(WORKBENCH_GENERATED_IN)
95 $(WAREHOUSE_GENERATED): config.yml $(WAREHOUSE_GENERATED_IN)
98 $(SSO_GENERATED): config.yml $(SSO_GENERATED_IN)
101 # The docker build -q option suppresses verbose build output.
102 # Necessary to prevent failure on building warehouse; see
103 # https://github.com/dotcloud/docker/issues/3172
104 DOCKER_BUILD = docker build -q
106 # ============================================================
107 # The main Arvados servers: api, doc, workbench, warehouse
109 api-image: passenger-image $(API_DEPS)
110 mkdir -p api/generated
111 tar -c -z -f api/generated/api.tar.gz -C ../services api --exclude=api/log/*
112 $(DOCKER_BUILD) -t arvados/api api
113 echo -n "Built at $(date)" > api-image
115 doc-image: base-image $(DOC_DEPS)
116 mkdir -p doc/generated
117 tar -c -z -f doc/generated/doc.tar.gz -C .. doc
118 $(DOCKER_BUILD) -t arvados/doc doc
119 echo -n "Built at $(date)" > doc-image
121 workbench-image: passenger-image $(WORKBENCH_DEPS)
122 mkdir -p workbench/generated
123 tar -c -z -f workbench/generated/workbench.tar.gz -C ../apps workbench
124 $(DOCKER_BUILD) -t arvados/workbench workbench
125 echo -n "Built at $(date)" > workbench-image
127 warehouse-image: base-image $(WAREHOUSE_DEPS)
128 $(DOCKER_BUILD) -t arvados/warehouse warehouse
129 echo -n "Built at $(date)" > warehouse-image
131 sso-image: passenger-image $(SSO_DEPS)
132 $(DOCKER_BUILD) -t arvados/sso sso
133 echo -n "Built at $(date)" > sso-image
135 # ============================================================
136 # The arvados/base image is the base Debian image plus packages
137 # that are dependencies for every Arvados service.
139 passenger-image: base-image
140 $(DOCKER_BUILD) -t arvados/passenger passenger
141 echo -n "Built at $(date)" > passenger-image
143 base-image: debian-image $(BASE_DEPS)
144 $(DOCKER_BUILD) -t arvados/base base
145 echo -n "Built at $(date)" > base-image
148 ./mkimage-debootstrap.sh arvados/debian wheezy ftp://ftp.us.debian.org/debian/
149 echo -n "Built at $(date)" > debian-image