Place docker files in scripts and update makefile

This commit is contained in:
Daniel Nelson 2018-10-11 00:05:51 -07:00
parent eece559fe7
commit 8a03a21de2
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
5 changed files with 5 additions and 15 deletions

View File

@ -113,9 +113,7 @@ clean:
.PHONY: docker-image .PHONY: docker-image
docker-image: docker-image:
./scripts/build.py --package --platform=linux --arch=amd64 docker build -f scripts/stretch.docker -t "telegraf:$(COMMIT)" .
cp build/telegraf*$(COMMIT)*.deb .
docker build -f scripts/dev.docker --build-arg "package=telegraf*$(COMMIT)*.deb" -t "telegraf-dev:$(COMMIT)" .
plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
ragel -Z -G2 $^ -o $@ ragel -Z -G2 $^ -o $@

View File

@ -5,7 +5,7 @@ WORKDIR /go/src/github.com/influxdata/telegraf
COPY Gopkg.toml Gopkg.lock ./ COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only RUN dep ensure -vendor-only
COPY . /go/src/github.com/influxdata/telegraf COPY . /go/src/github.com/influxdata/telegraf
RUN CGO_ENABLED=0 go install ./cmd/... RUN CGO_ENABLED=0 make go-install
FROM alpine:3.6 FROM alpine:3.6
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
@ -16,6 +16,6 @@ COPY etc/telegraf.conf /etc/telegraf/telegraf.conf
EXPOSE 8125/udp 8092/udp 8094 EXPOSE 8125/udp 8092/udp 8094
COPY docker/entrypoint.sh /entrypoint.sh COPY scripts/docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"] CMD ["telegraf"]

View File

@ -1,8 +0,0 @@
FROM debian:stretch
ARG package
ADD ${package} ${package}
RUN dpkg -i ${package}
EXPOSE 8125/udp 8092/udp 8094
CMD ["telegraf"]

View File

@ -5,7 +5,7 @@ WORKDIR /go/src/github.com/influxdata/telegraf
COPY Gopkg.toml Gopkg.lock ./ COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only RUN dep ensure -vendor-only
COPY . /go/src/github.com/influxdata/telegraf COPY . /go/src/github.com/influxdata/telegraf
RUN go install ./cmd/... RUN make go-install
FROM buildpack-deps:stretch-curl FROM buildpack-deps:stretch-curl
COPY --from=builder /go/bin/* /usr/bin/ COPY --from=builder /go/bin/* /usr/bin/
@ -13,6 +13,6 @@ COPY etc/telegraf.conf /etc/telegraf/telegraf.conf
EXPOSE 8125/udp 8092/udp 8094 EXPOSE 8125/udp 8092/udp 8094
COPY docker/entrypoint.sh /entrypoint.sh COPY scripts/docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"] CMD ["telegraf"]