forked from quay/clair
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
259 lines (235 loc) · 7.01 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# if you are using firewalld add this consistent bridge name
# to your trusted zone
# sudo firewall-cmd --zone=trusted --add-interface=clair --permanent
# sudo firewall-cmd --reload
networks:
default:
driver_opts:
com.docker.network.bridge.name: clair
version: "3.7"
services:
clair-db:
container_name: clair-db
image: postgres:12.1
environment:
POSTGRES_USER: "clair"
POSTGRES_DB: "clair"
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U clair -d clair"]
interval: 10s
timeout: 9s
retries: 3
start_period: 10s
pgadmin:
container_name: clair-pgadmin
image: dpage/pgadmin4:latest
environment:
PGADMIN_DEFAULT_EMAIL: clair@clair.com
PGADMIN_DEFAULT_PASSWORD: clair
PGADMIN_SERVER_JSON_FILE: /pgadmin4/config/servers.json
PGADMIN_LISTEN_PORT: 8081
ports:
- "8081:8081"
volumes:
- "./local-dev/pgadmin:/pgadmin4/config"
depends_on:
- clair-db
traefik:
container_name: clair-traefik
image: traefik:v2.2
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.clair.address=:6060"
- "--providers.docker.exposedbydefault=false"
- "--accesslog=true"
ports:
- "6060:6060"
- "7000:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
activemq:
container_name: clair-activemq
hostname: clair-activemq
image: webcenter/activemq:5.14.3
ports:
- "8161:8161"
- "61613:61613"
rabbitmq:
container_name: clair-rabbitmq
hostname: clair-rabbitmq
image: rabbitmq:3.8.5-management
ports:
- "5672:5672"
- "8087:15672"
environment:
RABBITMQ_VM_MEMORY_HIGH_WATERMARK: "85%"
notifier:
container_name: clair-notifier
image: quay.io/projectquay/golang:1.17
volumes:
- "./:/src/clair/"
environment:
CLAIR_CONF: "/src/clair/local-dev/clair/config.yaml"
CLAIR_MODE: "notifier"
command:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor ."]
labels:
- "traefik.enable=true"
- "traefik.http.routers.notifier.entrypoints=clair"
- "traefik.http.routers.notifier.rule=PathPrefix(`/notifier`)"
- "traefik.http.routers.notifier.service=notifier"
- "traefik.http.services.notifier.loadbalancer.server.port=6000"
# this should only be created and deleted via the make target "local-dev-notifier-test"
notifier-test-mode:
container_name: clair-notifier
image: quay.io/projectquay/golang:1.17
volumes:
- "./:/src/clair/"
environment:
CLAIR_CONF: "/src/clair/local-dev/clair/config.yaml"
CLAIR_MODE: "notifier"
NOTIFIER_TEST_MODE: "true"
command:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor ."]
labels:
- "traefik.enable=true"
- "traefik.http.routers.notifier.entrypoints=clair"
- "traefik.http.routers.notifier.rule=PathPrefix(`/notifier`)"
- "traefik.http.routers.notifier.service=notifier"
- "traefik.http.services.notifier.loadbalancer.server.port=6000"
indexer:
container_name: clair-indexer
image: quay.io/projectquay/golang:1.17
volumes:
- "./:/src/clair/"
environment:
CLAIR_CONF: "/src/clair/local-dev/clair/config.yaml"
CLAIR_MODE: "indexer"
command:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor ."]
labels:
- "traefik.enable=true"
- "traefik.http.routers.indexer.rule=PathPrefix(`/indexer`)"
- "traefik.http.routers.indexer.entrypoints=clair"
- "traefik.http.routers.indexer.service=indexer"
- "traefik.http.services.indexer.loadbalancer.server.port=6000"
## like the indexer service above, but mounts quay's http port into local
## network namespace.
##
## allows layer fetching over localhost
indexer-quay:
container_name: clair-indexer
image: quay.io/projectquay/golang:1.17
volumes:
- "./:/src/clair/"
environment:
CLAIR_CONF: "/src/clair/local-dev/clair/config.yaml"
CLAIR_MODE: "indexer"
network_mode: "service:quay"
command:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor ."]
labels:
- "traefik.enable=true"
- "traefik.http.routers.indexer.rule=PathPrefix(`/indexer`)"
- "traefik.http.routers.indexer.entrypoints=clair"
- "traefik.http.routers.indexer.service=indexer"
- "traefik.http.services.indexer.loadbalancer.server.port=6000"
depends_on:
- quay
- clair-db
matcher:
container_name: clair-matcher
image: quay.io/projectquay/golang:1.17
volumes:
- "./:/src/clair/"
environment:
CLAIR_CONF: "/src/clair/local-dev/clair/config.yaml"
CLAIR_MODE: "matcher"
command:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor ."]
labels:
- "traefik.enable=true"
- "traefik.http.routers.matcher.rule=PathPrefix(`/matcher`)"
- "traefik.http.routers.matcher.entrypoints=clair"
- "traefik.http.routers.matcher.service=matcher"
- "traefik.http.services.matcher.loadbalancer.server.port=6000"
swagger-ui:
container_name: clair-swagger
image: swaggerapi/swagger-ui
ports:
- "8082:8080"
volumes:
- "./:/clair"
environment:
SWAGGER_JSON: "/clair/openapi.yaml"
jaeger:
container_name: clair-jaeger
image: jaegertracing/all-in-one:1.17
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
- "16686:16686"
- "14268:14268"
- "14250:14250"
- "9411:9411"
environment:
COLLECTOR_ZIPKIN_HTTP_PORT: 9411
prometheus:
container_name: clair-prometheus
image: prom/prometheus:latest
volumes:
- "./local-dev/prometheus:/etc/prometheus/"
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- "9090:9090"
grafana:
container_name: clair-grafana
image: grafana/grafana:8.0.3
ports:
- 3000:3000
user: "472"
volumes:
- ./local-dev/grafana/provisioning/:/etc/grafana/provisioning/
depends_on:
- prometheus
## QUAY ##
redis:
container_name: clair-redis
image: redis:latest
ports:
- "6379:6379"
## quay MUST be bound to port 8080
quay:
container_name: clair-quay
image: quay.io/projectquay/quay:latest
privileged: true
volumes:
- "./local-dev/quay:/quay-registry/conf/stack"
ports:
- "8080:8080"
environment:
DEBUGLOG: "true"
IGNORE_VALIDATION: "true"
quay-db:
container_name: quay-db
image: postgres:12.1
environment:
POSTGRES_USER: "quay"
POSTGRES_DB: "quay"
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U quay -d quay"]
interval: 10s
timeout: 9s
retries: 3
start_period: 10s