From 8a3dcc096fe219bf6c746fd0c1f6806b5c358db8 Mon Sep 17 00:00:00 2001 From: lauren_tb Date: Tue, 12 Mar 2024 16:17:02 +0000 Subject: [PATCH 1/3] Amend Makefile Added --platform flag to enable container build on M* machines. Also added descriptions to increase visibility of options and to bring inline with other repos. --- Makefile | 12 +++++++++--- build.sh | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1ae11dc..3b3b2f8 100644 --- a/Makefile +++ b/Makefile @@ -2,10 +2,16 @@ include .env 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 \ No newline at end of file +help: + @grep -h -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/build.sh b/build.sh index 20c9788..7c10d3d 100755 --- a/build.sh +++ b/build.sh @@ -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 . From 1225bc3641bf6d784f56ee7fba2a06e2605eef1b Mon Sep 17 00:00:00 2001 From: "Stephen.James" Date: Tue, 12 Mar 2024 17:18:32 +0000 Subject: [PATCH 2/3] Allow make build to run locally without error --- Makefile | 4 +++- docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3b3b2f8..baf6dba 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ #!make -include .env +ifneq (,$(wildcard ./.env)) + include .env +endif export .DEFAULT_GOAL := help diff --git a/docker-compose.yml b/docker-compose.yml index 04787aa..66e3d38 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 - \ No newline at end of file From 22bd0cc7dae708fa8390c407e44576f6a183e843 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 12 Mar 2024 17:19:39 +0000 Subject: [PATCH 3/3] Commit changes made by code formatters --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 66e3d38..313ba06 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: '3' +version: "3" networks: monitor-net: