Skip to content

Commit

Permalink
build local container, use consistent container names (#960)
Browse files Browse the repository at this point in the history
Signed-off-by: ldelossa <[email protected]>
  • Loading branch information
Louis DeLosSantos authored Apr 1, 2020
1 parent cec05a3 commit 3c608d4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ local-dev-up: vendor
$(docker-compose) up -d jaeger
$(docker-compose) up -d prometheus
$(docker-compose) up -d clair-db
$(docker) exec -it clair_clair-db_1 bash -c 'while ! pg_isready; do echo "waiting for postgres"; sleep 2; done'
$(docker) exec -it clair-db bash -c 'while ! pg_isready; do echo "waiting for postgres"; sleep 2; done'
$(docker-compose) up -d indexer
$(docker-compose) up -d matcher
$(docker-compose) up -d swagger-ui
Expand All @@ -47,7 +47,7 @@ local-dev-down:
# often a service should be restarted as well to run migrations on the now schemaless database.
.PHONY: local-dev-db-restart
local-dev-db-restart:
$(docker) kill clair_clair-db_1 && $(docker) rm clair_clair-db_1
$(docker) kill clair-db && $(docker) rm clair-db
$(docker-compose) up -d --force-recreate clair-db

# restart the local development indexer, any local code changes will take effect
Expand Down
12 changes: 10 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: "3.7"
services:
clair-db:
container_name: clair-db
image: postgres:12.1
environment:
POSTGRES_USER: "clair"
Expand All @@ -15,7 +16,9 @@ services:
start_period: 10s

indexer:
image: quay.io/claircore/golang:1.13.3
container_name: clair-indexer
build: .
image: clair-local:latest
ports:
- "8080:80"
- "8089:8089"
Expand All @@ -28,7 +31,9 @@ services:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor . -conf /src/clair/local-dev/indexer/indexer.config.yaml"]

matcher:
image: quay.io/claircore/golang:1.13.3
container_name: matcher-indexer
image: clair-local:latest
build: .
ports:
- "8081:80"
- "8090:8089"
Expand All @@ -41,6 +46,7 @@ services:
["bash", "-c", "cd /src/clair/cmd/clair; go run -mod vendor . -conf /src/clair/local-dev/matcher/matcher.config.yaml"]

swagger-ui:
container_name: clair-swagger
image: swaggerapi/swagger-ui
ports:
- "8082:8080"
Expand All @@ -50,6 +56,7 @@ services:
SWAGGER_JSON: "/clair/openapi.yaml"

jaeger:
container_name: clair-jaeger
image: jaegertracing/all-in-one:1.17
ports:
- "5775:5775/udp"
Expand All @@ -64,6 +71,7 @@ services:
COLLECTOR_ZIPKIN_HTTP_PORT: 9411

prometheus:
container_name: clair-prometheus
image: prom/prometheus:latest
volumes:
- "./local-dev/prometheus:/etc/prometheus/"
Expand Down

0 comments on commit 3c608d4

Please sign in to comment.