Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amend Makefile - docker platform flag #18

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
#!make
include .env
ifneq (,$(wildcard ./.env))
include .env
endif
export

build:
.DEFAULT_GOAL := help

.PHONY: build
build: ## Get blackbox_exporter image from GitHub and build
./build.sh

run: build
.PHONY: run
run: ## Get blackbox_exporter image from GitHub, build and run against target in .env
$(MAKE) build
docker run -it -e PROM_USER=$$PROM_USER -e PROM_PASS=$$PROM_PASS -e PROM_TARGET=$$PROM_TARGET -e REMOTE_WRITE_URL=$$REMOTE_WRITE_URL app-reachability:latest

.PHONY: build run
help:
@grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ tar -xzvf tmp/bb.tar.gz -C ./tmp
mkdir -p build
mv ./tmp/blackbox_exporter-0.19.0.linux-amd64/blackbox_exporter ./build

docker build -t app-reachability .
docker build --platform linux/amd64 -t app-reachability .
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3'
version: "3"

networks:
monitor-net:
Expand All @@ -7,10 +7,10 @@ networks:
services:
reachability:
image: ghcr.io/ministryofjustice/staff-infrastructure-monitoring-app-reachability:main
platform: linux/x86_64
container_name: app-reachability
environment:
- PROM_USER= # basic auth username for prometheus
- PROM_PASS= # basic auth password for prometheus
- PROM_TARGET= # full url of http endpoint for monitoring
- REMOTE_WRITE_URL= # url for prometheus/thanos remote write