From 61767ce5881fc1bd7bd7bc105d234a3fd70acaa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20P=C5=82otka?= Date: Fri, 8 Mar 2019 09:17:54 +0000 Subject: [PATCH] Added jiralert docker image. (#22) Signed-off-by: Bartek Plotka --- Dockerfile | 6 ++++++ Makefile | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6354323 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM quay.io/prometheus/busybox:latest + +COPY jiralert /bin/jiralert + +ENTRYPOINT [ "/bin/jiralert" ] + diff --git a/Makefile b/Makefile index c1bcea1..fb2f96b 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,8 @@ RELEASE_DIR := release/$(RELEASE) PACKAGES := $(shell $(GO) list ./... | grep -v /vendor/) STATICCHECK_IGNORE := +DOCKER_IMAGE_NAME := jiralert + all: clean format staticcheck build clean: @@ -26,7 +28,14 @@ staticcheck: get_staticcheck build: @echo ">> building binaries" - @GOOS=linux GOARCH=amd64 $(GO) build -ldflags "-X main.Version=$(VERSION)" github.com/free/jiralert/cmd/jiralert + @# CGO must be disabled to run in busybox container. + @CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GO) build -ldflags "-X main.Version=$(VERSION)" github.com/free/jiralert/cmd/jiralert + + +# docker builds docker with no tag. +docker: build + @echo ">> building docker image '${DOCKER_IMAGE_NAME}'" + @docker build -t "${DOCKER_IMAGE_NAME}" . tarball: @echo ">> packaging release $(VERSION)"