You've already forked prometheus-fail2ban-exporter
build: compile tool during docker build
Update the project Dockerfile to compile the tool during the docker build instead of assuming the goreleaser tool was run previously. This allows for custom data to be set in the compiled tool (e.g. compiled by docker) and removes the dependency on another build step. Update the Makefile to include a new command to build the tool for docker which sets the version data correctly. Rename the docker commands to follow the `docker/build-...` format to avoid confusion with the build commands.
This commit is contained in:
6
Makefile
6
Makefile
@ -24,7 +24,11 @@ build/release:
|
||||
./tools/goreleaser_linux_amd64 --rm-dist --skip-publish
|
||||
|
||||
build/docker:
|
||||
cd src/ && go build -o exporter \
|
||||
-ldflags '-X main.version=$(shell git describe --tags) -X main.commit=${shell git rev-parse HEAD} -X "main.date=${shell date --rfc-3339=seconds}" -X main.builtBy=docker' exporter.go
|
||||
|
||||
docker/build-latest:
|
||||
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest .
|
||||
|
||||
build/docker-tag:
|
||||
docker/build-tag:
|
||||
docker build -t registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:$(shell git describe --tags) .
|
||||
|
Reference in New Issue
Block a user