make target to build docker image
This commit is contained in:
parent
ccb6b3c64b
commit
16634e9734
|
@ -0,0 +1 @@
|
|||
.git
|
|
@ -0,0 +1,10 @@
|
|||
FROM alpine
|
||||
|
||||
MAINTAINER ops@yotpo.com
|
||||
|
||||
RUN mkdir -p /etc/telegraf/telegraf.d/
|
||||
|
||||
COPY telegraf /usr/bin/
|
||||
COPY telegraf.conf /etc/telegraf/
|
||||
|
||||
CMD [ "/usr/bin/telegraf", "-config", "/etc/telegraf/telegraf.conf", "-config-directory", "/etc/telegraf/telegraf.d"]
|
6
Makefile
6
Makefile
|
@ -28,6 +28,12 @@ build-for-docker:
|
|||
"-X main.Version=$(VERSION)" \
|
||||
./cmd/telegraf/telegraf.go
|
||||
|
||||
build-docker: build-for-docker
|
||||
./telegraf -sample-config -input-filter cpu:mem -output-filter influxdb \
|
||||
| sed -e "s/localhost:8086/influxdb:8086/g" > telegraf.conf
|
||||
docker build -t influxdata/telegraf:$(VERSION) .
|
||||
rm telegraf.conf
|
||||
|
||||
# Build with race detector
|
||||
dev: prepare
|
||||
go build -race -o telegraf -ldflags \
|
||||
|
|
Loading…
Reference in New Issue