From 71a8f2c2b11b419bd8c0af1f859671e5d8730448 Mon Sep 17 00:00:00 2001 From: Callum Styan Date: Fri, 19 Apr 2024 16:36:57 -0700 Subject: [PATCH] fix: updated all dockerfiles go1.22 (#12708) Signed-off-by: Callum Styan --- clients/cmd/promtail/Dockerfile | 2 +- clients/cmd/promtail/Dockerfile.arm32 | 2 +- clients/cmd/promtail/Dockerfile.cross | 2 +- cmd/logcli/Dockerfile | 2 +- cmd/logql-analyzer/Dockerfile | 2 +- cmd/loki-canary-boringcrypto/Dockerfile | 2 +- cmd/loki-canary/Dockerfile | 2 +- cmd/loki-canary/Dockerfile.cross | 2 +- cmd/loki/Dockerfile | 2 +- cmd/loki/Dockerfile.cross | 2 +- cmd/loki/Dockerfile.debug | 2 +- cmd/migrate/Dockerfile | 2 +- cmd/querytee/Dockerfile | 2 +- cmd/querytee/Dockerfile.cross | 2 +- loki-build-image/Dockerfile | 18 +++++++++--------- operator/Dockerfile | 2 +- operator/Dockerfile.cross | 2 +- operator/calculator.Dockerfile | 2 +- production/helm/loki/src/helm-test/Dockerfile | 2 +- tools/dev/loki-tsdb-storage-s3/dev.dockerfile | 2 +- tools/lambda-promtail/Dockerfile | 2 +- tools/tsdb/bloom-tester/Dockerfile | 2 +- 22 files changed, 30 insertions(+), 30 deletions(-) diff --git a/clients/cmd/promtail/Dockerfile b/clients/cmd/promtail/Dockerfile index a7e4f1d16ed9..c18b96ddcc54 100644 --- a/clients/cmd/promtail/Dockerfile +++ b/clients/cmd/promtail/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9-bookworm as build +FROM golang:1.22.2-bookworm as build COPY . /src/loki WORKDIR /src/loki diff --git a/clients/cmd/promtail/Dockerfile.arm32 b/clients/cmd/promtail/Dockerfile.arm32 index 0e745ddb6f26..8724b1ff58b7 100644 --- a/clients/cmd/promtail/Dockerfile.arm32 +++ b/clients/cmd/promtail/Dockerfile.arm32 @@ -1,4 +1,4 @@ -FROM golang:1.21.9-bookworm as build +FROM golang:1.22.2-bookworm as build COPY . /src/loki WORKDIR /src/loki diff --git a/clients/cmd/promtail/Dockerfile.cross b/clients/cmd/promtail/Dockerfile.cross index 0c63c6a6e6e7..0968b99ea3fd 100644 --- a/clients/cmd/promtail/Dockerfile.cross +++ b/clients/cmd/promtail/Dockerfile.cross @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.33.1 # Directories in this file are referenced from the root of the project not this folder # This file is intended to be called from the root like so: # docker build -t grafana/promtail -f clients/cmd/promtail/Dockerfile . -FROM golang:1.21.9-alpine as goenv +FROM 1.22.2-alpine as goenv RUN go env GOARCH > /goarch && \ go env GOARM > /goarm diff --git a/cmd/logcli/Dockerfile b/cmd/logcli/Dockerfile index a0c8e3a67cd2..9eaf3dda8fc7 100644 --- a/cmd/logcli/Dockerfile +++ b/cmd/logcli/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2 as build COPY . /src/loki WORKDIR /src/loki diff --git a/cmd/logql-analyzer/Dockerfile b/cmd/logql-analyzer/Dockerfile index 1413a33e6249..abfbbe0c8851 100644 --- a/cmd/logql-analyzer/Dockerfile +++ b/cmd/logql-analyzer/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2 as build COPY . /src/loki WORKDIR /src/loki diff --git a/cmd/loki-canary-boringcrypto/Dockerfile b/cmd/loki-canary-boringcrypto/Dockerfile index 481450664180..932f70b50013 100644 --- a/cmd/loki-canary-boringcrypto/Dockerfile +++ b/cmd/loki-canary-boringcrypto/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2 as build COPY . /src/loki WORKDIR /src/loki diff --git a/cmd/loki-canary/Dockerfile b/cmd/loki-canary/Dockerfile index ec8889df25a5..930c0f3bb161 100644 --- a/cmd/loki-canary/Dockerfile +++ b/cmd/loki-canary/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2 as build COPY . /src/loki WORKDIR /src/loki diff --git a/cmd/loki-canary/Dockerfile.cross b/cmd/loki-canary/Dockerfile.cross index 60a5ff732f38..c137e65cce02 100644 --- a/cmd/loki-canary/Dockerfile.cross +++ b/cmd/loki-canary/Dockerfile.cross @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.33.1 # Directories in this file are referenced from the root of the project not this folder # This file is intended to be called from the root like so: # docker build -t grafana/promtail -f cmd/promtail/Dockerfile . -FROM golang:1.21.9-alpine as goenv +FROM golang:1.22.2-alpine as goenv RUN go env GOARCH > /goarch && \ go env GOARM > /goarm diff --git a/cmd/loki/Dockerfile b/cmd/loki/Dockerfile index 55c80ef61216..ed85213b0d2f 100644 --- a/cmd/loki/Dockerfile +++ b/cmd/loki/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2 as build COPY . /src/loki WORKDIR /src/loki diff --git a/cmd/loki/Dockerfile.cross b/cmd/loki/Dockerfile.cross index 833f9b266ba1..fcc475f6e77d 100644 --- a/cmd/loki/Dockerfile.cross +++ b/cmd/loki/Dockerfile.cross @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.33.1 # Directories in this file are referenced from the root of the project not this folder # This file is intended to be called from the root like so: # docker build -t grafana/loki -f cmd/loki/Dockerfile . -FROM golang:1.21.9-alpine as goenv +FROM golang:1.22.2-alpine as goenv RUN go env GOARCH > /goarch && \ go env GOARM > /goarm diff --git a/cmd/loki/Dockerfile.debug b/cmd/loki/Dockerfile.debug index 9b1f427a696e..def64b370b57 100644 --- a/cmd/loki/Dockerfile.debug +++ b/cmd/loki/Dockerfile.debug @@ -3,7 +3,7 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.33.1 # This file is intended to be called from the root like so: # docker build -t grafana/loki -f cmd/loki/Dockerfile.debug . -FROM golang:1.21.9-alpine as goenv +FROM golang:1.22.2-alpine as goenv RUN go env GOARCH > /goarch && \ go env GOARM > /goarm && \ go install github.com/go-delve/delve/cmd/dlv@latest diff --git a/cmd/migrate/Dockerfile b/cmd/migrate/Dockerfile index f83c26bf893d..91861fa718ff 100644 --- a/cmd/migrate/Dockerfile +++ b/cmd/migrate/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2 as build COPY . /src/loki WORKDIR /src/loki RUN make clean && make BUILD_IN_CONTAINER=false migrate diff --git a/cmd/querytee/Dockerfile b/cmd/querytee/Dockerfile index c32752b0604f..77be07225f5e 100644 --- a/cmd/querytee/Dockerfile +++ b/cmd/querytee/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2 as build COPY . /src/loki WORKDIR /src/loki diff --git a/cmd/querytee/Dockerfile.cross b/cmd/querytee/Dockerfile.cross index 5f84f9ab410d..05d63ee55325 100644 --- a/cmd/querytee/Dockerfile.cross +++ b/cmd/querytee/Dockerfile.cross @@ -2,7 +2,7 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.33.1 # Directories in this file are referenced from the root of the project not this folder # This file is intended to be called from the root like so: # docker build -t grafana/promtail -f cmd/promtail/Dockerfile . -FROM golang:1.21.9-alpine as goenv +FROM golang:1.22.2-alpine as goenv RUN go env GOARCH > /goarch && \ go env GOARM > /goarm diff --git a/loki-build-image/Dockerfile b/loki-build-image/Dockerfile index 3c040180fc92..beb7b0078dae 100644 --- a/loki-build-image/Dockerfile +++ b/loki-build-image/Dockerfile @@ -6,7 +6,7 @@ # on how to publish a new build image. # Install helm (https://helm.sh/) and helm-docs (https://github.com/norwoodj/helm-docs) for generating Helm Chart reference. -FROM golang:1.21.9-bullseye as helm +FROM golang:1.22.2-bookworm as helm ARG TARGETARCH ARG HELM_VER="v3.2.3" RUN curl -L "https://get.helm.sh/helm-${HELM_VER}-linux-$TARGETARCH.tar.gz" | tar zx && \ @@ -38,7 +38,7 @@ RUN apk add --no-cache curl && \ FROM alpine:3.18.6 as docker RUN apk add --no-cache docker-cli docker-cli-buildx -FROM golang:1.21.9-bullseye as drone +FROM golang:1.22.2-bookworm as drone ARG TARGETARCH RUN curl -L "https://github.com/drone/drone-cli/releases/download/v1.7.0/drone_linux_$TARGETARCH".tar.gz | tar zx && \ install -t /usr/local/bin drone @@ -48,35 +48,35 @@ RUN curl -L "https://github.com/drone/drone-cli/releases/download/v1.7.0/drone_l # Error: # github.com/fatih/faillint@v1.5.0 requires golang.org/x/tools@v0.0.0-20200207224406-61798d64f025 # (not golang.org/x/tools@v0.0.0-20190918214920-58d531046acd from golang.org/x/tools/cmd/goyacc@58d531046acdc757f177387bc1725bfa79895d69) -FROM golang:1.21.9-bullseye as faillint +FROM golang:1.22.2-bookworm as faillint RUN GO111MODULE=on go install github.com/fatih/faillint@v1.11.0 RUN GO111MODULE=on go install golang.org/x/tools/cmd/goimports@v0.7.0 -FROM golang:1.21.9-bullseye as delve +FROM golang:1.22.2-bookworm as delve RUN GO111MODULE=on go install github.com/go-delve/delve/cmd/dlv@latest # Install ghr used to push binaries and template the release # This collides with the version of go tools used in the base image, thus we install it in its own image and copy it over. -FROM golang:1.21.9-bullseye as ghr +FROM golang:1.22.2-bookworm as ghr RUN GO111MODULE=on go install github.com/tcnksm/ghr@9349474 # Install nfpm (https://nfpm.goreleaser.com) for creating .deb and .rpm packages. -FROM golang:1.21.9-bullseye as nfpm +FROM golang:1.22.2-bookworm as nfpm RUN GO111MODULE=on go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.11.3 # Install gotestsum -FROM golang:1.21.9-bullseye as gotestsum +FROM golang:1.22.2-bookworm as gotestsum RUN GO111MODULE=on go install gotest.tools/gotestsum@v1.8.2 # Install tools used to compile jsonnet. -FROM golang:1.21.9-bullseye as jsonnet +FROM golang:1.22.2-bookworm as jsonnet RUN GO111MODULE=on go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.5.1 RUN GO111MODULE=on go install github.com/monitoring-mixins/mixtool/cmd/mixtool@16dc166166d91e93475b86b9355a4faed2400c18 RUN GO111MODULE=on go install github.com/google/go-jsonnet/cmd/jsonnet@v0.20.0 FROM aquasec/trivy as trivy -FROM golang:1.21.9-bullseye +FROM golang:1.22.2-bookworm RUN apt-get update && \ apt-get install -qy \ musl gnupg ragel \ diff --git a/operator/Dockerfile b/operator/Dockerfile index 5f155e833f76..6e03c5d92bcc 100644 --- a/operator/Dockerfile +++ b/operator/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.21.9 as builder +FROM golang:1.22.2 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/operator/Dockerfile.cross b/operator/Dockerfile.cross index 060edee23948..a1b6d8853b44 100644 --- a/operator/Dockerfile.cross +++ b/operator/Dockerfile.cross @@ -1,6 +1,6 @@ ARG BUILD_IMAGE=grafana/loki-build-image:0.33.1 -FROM golang:1.21.9-alpine as goenv +FROM golang:1.22.2-alpine as goenv RUN go env GOARCH > /goarch && \ go env GOARM > /goarm diff --git a/operator/calculator.Dockerfile b/operator/calculator.Dockerfile index 9ffd31d1154d..4a1a89cc83dc 100644 --- a/operator/calculator.Dockerfile +++ b/operator/calculator.Dockerfile @@ -1,5 +1,5 @@ # Build the calculator binary -FROM golang:1.21.9 as builder +FROM golang:1.22.2 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/production/helm/loki/src/helm-test/Dockerfile b/production/helm/loki/src/helm-test/Dockerfile index cf4420a2a68d..48ff7e8a6a27 100644 --- a/production/helm/loki/src/helm-test/Dockerfile +++ b/production/helm/loki/src/helm-test/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.3 as build +FROM golang:1.22.2 as build # build via Makefile target helm-test-image in root # Makefile. Building from this directory will not be diff --git a/tools/dev/loki-tsdb-storage-s3/dev.dockerfile b/tools/dev/loki-tsdb-storage-s3/dev.dockerfile index e1d11efb2c5a..98531c69145b 100644 --- a/tools/dev/loki-tsdb-storage-s3/dev.dockerfile +++ b/tools/dev/loki-tsdb-storage-s3/dev.dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 +FROM golang:1.22.2 ENV CGO_ENABLED=0 RUN go install github.com/go-delve/delve/cmd/dlv@v1.22.1 diff --git a/tools/lambda-promtail/Dockerfile b/tools/lambda-promtail/Dockerfile index 42f17c0a96c8..4cb51bcbe84d 100644 --- a/tools/lambda-promtail/Dockerfile +++ b/tools/lambda-promtail/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9-alpine AS build-image +FROM golang:1.22.2-alpine AS build-image COPY tools/lambda-promtail /src/lambda-promtail WORKDIR /src/lambda-promtail diff --git a/tools/tsdb/bloom-tester/Dockerfile b/tools/tsdb/bloom-tester/Dockerfile index 136ef1e8cc33..3db7db012e43 100644 --- a/tools/tsdb/bloom-tester/Dockerfile +++ b/tools/tsdb/bloom-tester/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9 as build +FROM golang:1.22.2-bookworm as build ENV BUILD_IN_CONTAINER=false COPY . /src/bloom-tester