2020-03-16 23:21:21 +00:00
|
|
|
FROM golang:1.13.8 as builder
|
2018-10-11 01:38:43 +00:00
|
|
|
WORKDIR /go/src/github.com/influxdata/telegraf
|
2020-03-16 23:21:21 +00:00
|
|
|
|
2018-10-11 01:38:43 +00:00
|
|
|
COPY . /go/src/github.com/influxdata/telegraf
|
2018-10-11 07:05:51 +00:00
|
|
|
RUN CGO_ENABLED=0 make go-install
|
2018-10-11 01:38:43 +00:00
|
|
|
|
|
|
|
FROM alpine:3.6
|
|
|
|
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
|
|
|
|
RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors && \
|
|
|
|
update-ca-certificates
|
|
|
|
COPY --from=builder /go/bin/* /usr/bin/
|
|
|
|
COPY etc/telegraf.conf /etc/telegraf/telegraf.conf
|
|
|
|
|
|
|
|
EXPOSE 8125/udp 8092/udp 8094
|
|
|
|
|
2018-10-11 07:05:51 +00:00
|
|
|
COPY scripts/docker-entrypoint.sh /entrypoint.sh
|
2018-10-11 01:38:43 +00:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
|
CMD ["telegraf"]
|