make target to build docker image

This commit is contained in:
Andrei Burd 2016-02-15 11:29:31 +02:00
parent ccb6b3c64b
commit 16634e9734
3 changed files with 17 additions and 0 deletions

1
.dockerignore Normal file
View File

@ -0,0 +1 @@
.git

10
Dockerfile Normal file
View File

@ -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"]

View File

@ -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 \