Dockerfile.debian 939 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. from debian as golang
  2. RUN apt-get update
  3. RUN apt-get install -y git golang
  4. RUN git clone https://go.googlesource.com/go
  5. WORKDIR /go
  6. RUN git checkout release-branch.go1.10
  7. WORKDIR /go/src
  8. RUN ./all.bash
  9. ##########################
  10. from debian as build
  11. RUN apt-get update
  12. RUN apt-get install -y git
  13. COPY --from=golang /go /go-bin
  14. ENV PATH=/go-bin/bin:$PATH
  15. ENV GOROOT=/go-bin
  16. ENV GOPATH=/go
  17. ENV GOBIN=/go/bin
  18. ENV PATH=$PATH:/go/bin
  19. RUN go get -u github.com/influxdata/influxdb
  20. WORKDIR /go/src/github.com/influxdata/influxdb/cmd/influxd
  21. RUN go get
  22. RUN go install
  23. WORKDIR /go/src/github.com/influxdata/influxdb/cmd/influx
  24. RUN go get
  25. RUN go install
  26. ########################
  27. FROM debian as main
  28. COPY --from=build /go/bin/influx* /usr/bin/
  29. ADD influxdb.conf /etc/influxdb/influxdb.conf
  30. VOLUME /var/lib/influxdb/
  31. COPY entrypoint.sh /entrypoint.sh
  32. COPY init-influxdb.sh /init-influxdb.sh
  33. ENTRYPOINT ["/entrypoint.sh"]
  34. CMD ["influxd"]