Skip to content

Commit 7730d9e

Browse files
ivankfzipper-meng
authored andcommitted
add Dockerfile
1 parent d160276 commit 7730d9e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Dockerfile

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM golang:latest as builder
2+
WORKDIR /go/src/github.com/cnosdb/telegraf
3+
COPY . /go/src/github.com/cnosdb/telegraf
4+
RUN go env -w GOPROXY="https://goproxy.cn"
5+
RUN go build -o telegraf ./cmd/telegraf
6+
7+
FROM ubuntu:latest
8+
COPY --from=builder /go/src/github.com/cnosdb/telegraf/telegraf /usr/bin/
9+
RUN mkdir -p /etc/telegraf/
10+
RUN /usr/bin/telegraf config > /etc/telegraf/telegraf.conf
11+
CMD ["telegraf"]

0 commit comments

Comments
 (0)