这是indexloc提供的服务,不要输入任何密码
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ GO := GO15VENDOREXPERIMENT=1 go
PROMU := $(GOPATH)/bin/promu
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)

DOCKER_RUN = docker run --rm -v $(shell pwd):/go/src/github.com/hnlq715/nginx-vts-exporter -w /go/src/github.com/hnlq715/nginx-vts-exporter/
GOLANG_CONTAINER = golang:1.9

PREFIX ?= $(shell pwd)
BIN_DIR ?= $(shell pwd)
DOCKER_IMAGE_NAME ?= nginx-vts-exporter
Expand Down Expand Up @@ -29,6 +32,9 @@ vet:
build: promu
@echo ">> building binaries"
@$(PROMU) build --prefix $(PREFIX)

buildindocker:
$(DOCKER_RUN) -e CGO_ENABLED=0 $(GOLANG_CONTAINER) /bin/bash -c "go get -u github.com/prometheus/promu && go build -a -installsuffix cgo -ldflags \"-w\" -o nginx-vts-exporter *.go"

crossbuild: promu
@echo ">> crossbuilding binaries"
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,16 @@ Binary can be downloaded from [Releases](https://github.com/hnlq715/nginx-vts-ex
## Compile

### build binary

#### build local
``` shell
make
```
OR

#### build in docker
``` shell
make buildindocker
```

### build docker image
``` shell
Expand Down