Skip to content

Commit

Permalink
Place docker files in scripts and update makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson authored and Mathieu Lecarme committed Apr 17, 2020
1 parent 8b67840 commit 63b63b8
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,7 @@ clean:

.PHONY: docker-image
docker-image:
./scripts/build.py --package --platform=linux --arch=amd64
cp build/telegraf*$(COMMIT)*.deb .
docker build -f scripts/dev.docker --build-arg "package=telegraf*$(COMMIT)*.deb" -t "telegraf-dev:$(COMMIT)" .
docker build -f scripts/stretch.docker -t "telegraf:$(COMMIT)" .

plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
ragel -Z -G2 $^ -o $@
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.alpine → scripts/alpine.docker
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /go/src/github.com/influxdata/telegraf
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only
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
RUN echo 'hosts: files dns' >> /etc/nsswitch.conf
Expand All @@ -16,6 +16,6 @@ COPY etc/telegraf.conf /etc/telegraf/telegraf.conf

EXPOSE 8125/udp 8092/udp 8094

COPY docker/entrypoint.sh /entrypoint.sh
COPY scripts/docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"]
8 changes: 0 additions & 8 deletions scripts/dev.docker

This file was deleted.

File renamed without changes.
4 changes: 2 additions & 2 deletions Dockerfile → scripts/stretch.docker
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ WORKDIR /go/src/github.com/influxdata/telegraf
COPY Gopkg.toml Gopkg.lock ./
RUN dep ensure -vendor-only
COPY . /go/src/github.com/influxdata/telegraf
RUN go install ./cmd/...
RUN make go-install

FROM buildpack-deps:stretch-curl
COPY --from=builder /go/bin/* /usr/bin/
COPY etc/telegraf.conf /etc/telegraf/telegraf.conf

EXPOSE 8125/udp 8092/udp 8094

COPY docker/entrypoint.sh /entrypoint.sh
COPY scripts/docker-entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["telegraf"]

0 comments on commit 63b63b8

Please sign in to comment.