Skip to content

Commit

Permalink
add Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankf authored and zipper-meng committed Oct 29, 2024
1 parent 160548d commit 7aa7c51
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:latest as builder
WORKDIR /go/src/github.com/cnosdb/telegraf
COPY . /go/src/github.com/cnosdb/telegraf
RUN go env -w GOPROXY="https://goproxy.cn"
RUN go build -o telegraf ./cmd/telegraf

FROM ubuntu:latest
COPY --from=builder /go/src/github.com/cnosdb/telegraf/telegraf /usr/bin/
RUN mkdir -p /etc/telegraf/
RUN /usr/bin/telegraf config > /etc/telegraf/telegraf.conf
CMD ["telegraf"]

0 comments on commit 7aa7c51

Please sign in to comment.