Skip to content

Commit

Permalink
Amend Makefile
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
laurentb4 committed Mar 12, 2024
1 parent ee13a2a commit 8a3dcc0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 .

0 comments on commit 8a3dcc0

Please sign in to comment.