From 74bbcac51c11eac38db060f79682f2fa436762d2 Mon Sep 17 00:00:00 2001 From: Steven Soroka Date: Fri, 28 Aug 2020 16:39:55 -0400 Subject: [PATCH] fix docker build. update dockerfiles to Go 1.14 (#8051) --- Makefile | 5 +++++ scripts/alpine.docker | 4 ++-- scripts/stretch.docker | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b387b9d4c8885..b920acc7c67bf 100644 --- a/Makefile +++ b/Makefile @@ -94,6 +94,11 @@ deps: telegraf: go build -ldflags "$(LDFLAGS)" ./cmd/telegraf +# Used by dockerfile builds +.PHONY: go-install +go-install: + go install -ldflags "-w -s $(LDFLAGS)" ./cmd/telegraf + .PHONY: test test: go test -short $(race_detector) ./... diff --git a/scripts/alpine.docker b/scripts/alpine.docker index 35083e5a30f41..395cbd8a33bc7 100644 --- a/scripts/alpine.docker +++ b/scripts/alpine.docker @@ -1,10 +1,10 @@ -FROM golang:1.13.13 as builder +FROM golang:1.14.7 as builder WORKDIR /go/src/github.com/influxdata/telegraf COPY . /go/src/github.com/influxdata/telegraf RUN CGO_ENABLED=0 make go-install -FROM alpine:3.6 +FROM alpine:3.12 RUN echo 'hosts: files dns' >> /etc/nsswitch.conf RUN apk add --no-cache iputils ca-certificates net-snmp-tools procps lm_sensors && \ update-ca-certificates diff --git a/scripts/stretch.docker b/scripts/stretch.docker index 7dbd02683e967..642421513c65d 100644 --- a/scripts/stretch.docker +++ b/scripts/stretch.docker @@ -1,4 +1,4 @@ -FROM golang:1.13.13 as builder +FROM golang:1.14.7-stretch as builder WORKDIR /go/src/github.com/influxdata/telegraf COPY . /go/src/github.com/influxdata/telegraf