diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cb7aae6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM prom/busybox:latest +MAINTAINER The alertmanager2es authors + +COPY alertmanager2es /bin/alertmanager2es + +EXPOSE 9097 +ENTRYPOINT [ "/bin/alertmanager2es" ] diff --git a/Makefile b/Makefile index 08fb0bd..92cc746 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,13 @@ -.PHONY: build test +.PHONY: build test docker + +DOCKER_IMAGE_NAME ?= alertmanager2es +DOCKER_IMAGE_TAG ?= $(subst /,-,$(shell git rev-parse --abbrev-ref HEAD)) build: test - go build -ldflags "-X main.revision=$(shell git describe --tags --always --dirty=-dev)" + go build -ldflags "-X main.revision=$(shell git describe --tags --always --dirty=-dev)" -tags netgo test: go test $(go list ./... | grep -v /vendor/) + +docker: + @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .