Dockerfile 644 B

12345678910111213141516171819202122232425262728293031
  1. from alpine as build
  2. RUN apk add --update git go musl-dev
  3. ENV GOPATH=/go
  4. ENV GOBIN=/go/bin
  5. ENV PATH=$PATH:/go/bin
  6. RUN go get -u github.com/influxdata/influxdb
  7. WORKDIR /go/src/github.com/influxdata/influxdb/cmd/influxd
  8. RUN go get
  9. RUN go install
  10. WORKDIR /go/src/github.com/influxdata/influxdb/cmd/influx
  11. RUN go get
  12. RUN go install
  13. ########################
  14. FROM alpine as main
  15. RUN apk add --update bash
  16. COPY --from=build /go/bin/influx* /usr/bin/
  17. ADD influxdb.conf /etc/influxdb/influxdb.conf
  18. VOLUME /var/lib/influxdb/
  19. COPY entrypoint.sh /entrypoint.sh
  20. COPY init-influxdb.sh /init-influxdb.sh
  21. ENTRYPOINT ["/entrypoint.sh"]
  22. CMD ["influxd"]