Skip to content

Commit 05b6a65

Browse files
authored
fix: Revert build image to Debian Bullseye to fix libc version issue in Promtail (#14387)
Backport of #14368 to 3.1.x release branch Signed-off-by: Christian Haudum <christian.haudum@gmail.com>
1 parent 3a6cd0a commit 05b6a65

File tree

12 files changed

+120
-108
lines changed

12 files changed

+120
-108
lines changed

‎.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"check":
33
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
44
"with":
5-
"build_image": "grafana/loki-build-image:0.33.5"
5+
"build_image": "grafana/loki-build-image:0.33.7"
66
"golang_ci_lint_version": "v1.55.1"
77
"release_lib_ref": "main"
88
"skip_validation": false

‎.github/workflows/minor-release-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
check:
1717
uses: "grafana/loki-release/.github/workflows/check.yml@main"
1818
with:
19-
build_image: "grafana/loki-build-image:0.33.5"
19+
build_image: "grafana/loki-build-image:0.33.7"
2020
golang_ci_lint_version: "v1.55.1"
2121
release_lib_ref: "main"
2222
skip_validation: false
@@ -143,7 +143,7 @@ jobs:
143143
--env SKIP_ARM \
144144
--volume .:/src/loki \
145145
--workdir /src/loki \
146-
--entrypoint /bin/sh "grafana/loki-build-image:0.33.5"
146+
--entrypoint /bin/sh "grafana/loki-build-image:0.33.7"
147147
git config --global --add safe.directory /src/loki
148148
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
149149
make dist packages

‎.github/workflows/patch-release-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
check:
1717
uses: "grafana/loki-release/.github/workflows/check.yml@main"
1818
with:
19-
build_image: "grafana/loki-build-image:0.33.5"
19+
build_image: "grafana/loki-build-image:0.33.7"
2020
golang_ci_lint_version: "v1.55.1"
2121
release_lib_ref: "main"
2222
skip_validation: false
@@ -143,7 +143,7 @@ jobs:
143143
--env SKIP_ARM \
144144
--volume .:/src/loki \
145145
--workdir /src/loki \
146-
--entrypoint /bin/sh "grafana/loki-build-image:0.33.5"
146+
--entrypoint /bin/sh "grafana/loki-build-image:0.33.7"
147147
git config --global --add safe.directory /src/loki
148148
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
149149
make dist packages

‎Makefile

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
3737
BUILD_IN_CONTAINER ?= true
3838

3939
# ensure you run `make drone` and `make release-workflows` after changing this
40-
BUILD_IMAGE_VERSION ?= 0.33.5
40+
BUILD_IMAGE_VERSION ?= 0.33.7
41+
GO_VERSION := 1.22.6
4142

4243
# Docker image info
4344
IMAGE_PREFIX ?= grafana
@@ -141,7 +142,7 @@ logcli: cmd/logcli/logcli ## build logcli executable
141142
logcli-debug: cmd/logcli/logcli-debug ## build debug logcli executable
142143

143144
logcli-image: ## build logcli docker image
144-
$(SUDO) docker build -t $(IMAGE_PREFIX)/logcli:$(IMAGE_TAG) -f cmd/logcli/Dockerfile .
145+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/logcli:$(IMAGE_TAG) -f cmd/logcli/Dockerfile .
145146

146147
cmd/logcli/logcli:
147148
CGO_ENABLED=0 go build $(GO_FLAGS) -o $@ ./cmd/logcli
@@ -597,9 +598,9 @@ endef
597598

598599
# promtail
599600
promtail-image: ## build the promtail docker image
600-
$(SUDO) docker build -t $(IMAGE_PREFIX)/promtail:$(IMAGE_TAG) -f clients/cmd/promtail/Dockerfile .
601+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/promtail:$(IMAGE_TAG) -f clients/cmd/promtail/Dockerfile .
601602
promtail-image-cross:
602-
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/promtail:$(IMAGE_TAG) -f clients/cmd/promtail/Dockerfile.cross .
603+
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/promtail:$(IMAGE_TAG) -f clients/cmd/promtail/Dockerfile.cross .
603604

604605
promtail-debug-image: ## build the promtail debug docker image
605606
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/promtail:$(IMAGE_TAG)-debug -f clients/cmd/promtail/Dockerfile.debug .
@@ -609,47 +610,47 @@ promtail-push: promtail-image-cross
609610

610611
# loki
611612
loki-image: ## build the loki docker image
612-
$(SUDO) docker build -t $(IMAGE_PREFIX)/loki:$(IMAGE_TAG) -f cmd/loki/Dockerfile .
613+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki:$(IMAGE_TAG) -f cmd/loki/Dockerfile .
613614
loki-image-cross:
614-
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/loki:$(IMAGE_TAG) -f cmd/loki/Dockerfile.cross .
615+
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki:$(IMAGE_TAG) -f cmd/loki/Dockerfile.cross .
615616

616617
loki-debug-image: ## build the debug loki docker image
617-
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/loki:$(IMAGE_TAG)-debug -f cmd/loki/Dockerfile.debug .
618+
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki:$(IMAGE_TAG)-debug -f cmd/loki/Dockerfile.debug .
618619

619620
loki-push: loki-image-cross
620621
$(call push-image,loki)
621622

622623
# loki-canary
623624
loki-canary-image: ## build the loki canary docker image
624-
$(SUDO) docker build -t $(IMAGE_PREFIX)/loki-canary:$(IMAGE_TAG) -f cmd/loki-canary/Dockerfile .
625+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-canary:$(IMAGE_TAG) -f cmd/loki-canary/Dockerfile .
625626
loki-canary-image-cross:
626-
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/loki-canary:$(IMAGE_TAG) -f cmd/loki-canary/Dockerfile.cross .
627+
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-canary:$(IMAGE_TAG) -f cmd/loki-canary/Dockerfile.cross .
627628
loki-canary-image-cross-boringcrypto:
628-
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/loki-canary-boringcrypto:$(IMAGE_TAG) -f cmd/loki-canary-boringcrypto/Dockerfile .
629+
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-canary-boringcrypto:$(IMAGE_TAG) -f cmd/loki-canary-boringcrypto/Dockerfile .
629630
loki-canary-push: loki-canary-image-cross
630631
$(SUDO) $(PUSH_OCI) $(IMAGE_PREFIX)/loki-canary:$(IMAGE_TAG)
631632
loki-canary-push-boringcrypto: loki-canary-image-cross-boringcrypto
632633
$(SUDO) $(PUSH_OCI) $(IMAGE_PREFIX)/loki-canary-boringcrypto:$(IMAGE_TAG)
633634
helm-test-image: ## build the helm test image
634-
$(SUDO) docker build -t $(IMAGE_PREFIX)/loki-helm-test:$(IMAGE_TAG) -f production/helm/loki/src/helm-test/Dockerfile .
635+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-helm-test:$(IMAGE_TAG) -f production/helm/loki/src/helm-test/Dockerfile .
635636
helm-test-push: helm-test-image ## push the helm test image
636637
$(SUDO) $(PUSH_OCI) $(IMAGE_PREFIX)/loki-helm-test:$(IMAGE_TAG)
637638

638639
# loki-querytee
639640
loki-querytee-image:
640-
$(SUDO) docker build -t $(IMAGE_PREFIX)/loki-query-tee:$(IMAGE_TAG) -f cmd/querytee/Dockerfile .
641+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-query-tee:$(IMAGE_TAG) -f cmd/querytee/Dockerfile .
641642
loki-querytee-image-cross:
642-
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/loki-query-tee:$(IMAGE_TAG) -f cmd/querytee/Dockerfile.cross .
643+
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-query-tee:$(IMAGE_TAG) -f cmd/querytee/Dockerfile.cross .
643644
loki-querytee-push: loki-querytee-image-cross
644645
$(SUDO) $(PUSH_OCI) $(IMAGE_PREFIX)/loki-query-tee:$(IMAGE_TAG)
645646

646647
# migrate-image
647648
migrate-image:
648-
$(SUDO) docker build -t $(IMAGE_PREFIX)/loki-migrate:$(IMAGE_TAG) -f cmd/migrate/Dockerfile .
649+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-migrate:$(IMAGE_TAG) -f cmd/migrate/Dockerfile .
649650

650651
# LogQL Analyzer
651652
logql-analyzer-image: ## build the LogQL Analyzer image
652-
$(SUDO) docker build -t $(IMAGE_PREFIX)/logql-analyzer:$(IMAGE_TAG) -f cmd/logql-analyzer/Dockerfile .
653+
$(SUDO) docker build --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/logql-analyzer:$(IMAGE_TAG) -f cmd/logql-analyzer/Dockerfile .
653654
logql-analyzer-push: logql-analyzer-image ## push the LogQL Analyzer image
654655
$(call push-image,logql-analyzer)
655656

@@ -663,7 +664,7 @@ else
663664
endif
664665

665666
build-image: ensure-buildx-builder
666-
$(SUDO) $(BUILD_OCI) -t $(IMAGE_PREFIX)/loki-build-image:$(IMAGE_TAG) ./loki-build-image
667+
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) ./loki-build-image
667668
build-image-push: build-image ## push the docker build image
668669
ifneq (,$(findstring WIP,$(IMAGE_TAG)))
669670
@echo "Cannot push a WIP image, commit changes first"; \
@@ -906,6 +907,13 @@ release-workflows:
906907

907908
.PHONY: release-workflows-check
908909
release-workflows-check:
910+
ifeq ($(BUILD_IN_CONTAINER),true)
911+
$(SUDO) docker run $(RM) $(TTY) -i \
912+
-v $(shell go env GOPATH)/pkg:/go/pkg$(MOUNT_FLAGS) \
913+
-v $(shell pwd):/src/loki$(MOUNT_FLAGS) \
914+
$(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) $@;
915+
else
909916
@$(MAKE) release-workflows
910917
@echo "Checking diff"
911918
@git diff --exit-code -- ".github/workflows/*release*" || (echo "Please build release workflows by running 'make release-workflows'" && false)
919+
endif

‎docs/sources/community/maintaining/release-loki-build-image.md

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,11 @@ if any changes were made in the folder `./loki-build-image/`.
1414

1515
**To build and use the `loki-build-image`:**
1616

17-
## Step 1
18-
19-
1. Create a branch with the desired changes to the Dockerfile.
20-
2. Update the version tag of the `loki-build-image` pipeline defined in `.drone/drone.jsonnet` (search for `pipeline('loki-build-image')`) to a new version number (try to follow semver).
21-
3. Run `DRONE_SERVER=https://drone.grafana.net/ DRONE_TOKEN=<token> make drone` and commit the changes to the same branch.
22-
1. The `<token>` is your personal drone token, which can be found by navigating to https://drone.grafana.net/account.
23-
4. Create a PR.
24-
5. Once approved and merged to `main`, the image with the new version is built and published.
25-
{{% admonition type="note" %}}
26-
Keep an eye on https://drone.grafana.net/grafana/loki for the build after merging ([example](https://drone.grafana.net/grafana/loki/17760/1/2)).
27-
{{% /admonition %}}
28-
29-
## Step 2
30-
31-
1. Create a branch.
32-
2. Update the `BUILD_IMAGE_VERSION` variable in the `Makefile`.
33-
3. Run `loki-build-image/version-updater.sh <new-version>` to update all the references.
34-
4. Run `DRONE_SERVER=https://drone.grafana.net/ DRONE_TOKEN=<token> make drone` to update the Drone config to use the new build image.
35-
5. Create a new PR.
36-
17+
1. Create a branch with the desired changes to the `./loki-build-image/Dockerfile`.
18+
1. Update the `BUILD_IMAGE_VERSION` variable in the `Makefile`.
19+
1. Commit your changes.
20+
1. Run `make build-image-push` to build and publish the new version of the build image.
21+
1. Run `make release-workflows` to update the Github workflows.
22+
1. Commit your changes.
23+
1. Push your changes to the remote branch.
24+
1. Open a PR against the `main` branch.

‎loki-build-image/Dockerfile

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
# tag of the Docker image in `../.drone/drone.jsonnet` and run `make drone`.
55
# See ../docs/sources/community/maintaining/release-loki-build-image.md for instructions
66
# on how to publish a new build image.
7-
7+
ARG GO_VERSION=1.22.6
88
# Install helm (https://helm.sh/) and helm-docs (https://github.com/norwoodj/helm-docs) for generating Helm Chart reference.
9-
FROM golang:1.22.5-bookworm as helm
9+
FROM golang:${GO_VERSION}-bullseye AS helm
1010
ARG TARGETARCH
1111
ARG HELM_VER="v3.2.3"
1212
RUN curl -L "https://get.helm.sh/helm-${HELM_VER}-linux-$TARGETARCH.tar.gz" | tar zx && \
@@ -15,7 +15,7 @@ RUN BIN=$([ "$TARGETARCH" = "arm64" ] && echo "helm-docs_Linux_arm64" || echo "h
1515
curl -L "https://github.com/norwoodj/helm-docs/releases/download/v1.11.2/$BIN.tar.gz" | tar zx && \
1616
install -t /usr/local/bin helm-docs
1717

18-
FROM alpine:3.20.2 as lychee
18+
FROM alpine:3.20.2 AS lychee
1919
ARG TARGETARCH
2020
ARG LYCHEE_VER="0.7.0"
2121
RUN apk add --no-cache curl && \
@@ -24,21 +24,21 @@ RUN apk add --no-cache curl && \
2424
mv /tmp/lychee /usr/bin/lychee && \
2525
rm -rf "/tmp/linux-$TARGETARCH" /tmp/lychee-$LYCHEE_VER.tgz
2626

27-
FROM alpine:3.20.2 as golangci
27+
FROM alpine:3.20.2 AS golangci
2828
RUN apk add --no-cache curl && \
2929
cd / && \
3030
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.55.1
3131

32-
FROM alpine:3.20.2 as buf
32+
FROM alpine:3.20.2 AS buf
3333
ARG TARGETOS
3434
RUN apk add --no-cache curl && \
3535
curl -sSL "https://github.com/bufbuild/buf/releases/download/v1.4.0/buf-$TARGETOS-$(uname -m)" -o "/usr/bin/buf" && \
3636
chmod +x "/usr/bin/buf"
3737

38-
FROM alpine:3.20.2 as docker
38+
FROM alpine:3.20.2 AS docker
3939
RUN apk add --no-cache docker-cli docker-cli-buildx
4040

41-
FROM golang:1.22.5-bookworm as drone
41+
FROM golang:${GO_VERSION}-bullseye AS drone
4242
ARG TARGETARCH
4343
RUN curl -L "https://github.com/drone/drone-cli/releases/download/v1.7.0/drone_linux_$TARGETARCH".tar.gz | tar zx && \
4444
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
4848
# Error:
4949
# github.com/fatih/faillint@v1.5.0 requires golang.org/x/tools@v0.0.0-20200207224406-61798d64f025
5050
# (not golang.org/x/tools@v0.0.0-20190918214920-58d531046acd from golang.org/x/tools/cmd/goyacc@58d531046acdc757f177387bc1725bfa79895d69)
51-
FROM golang:1.22.5-bookworm as faillint
51+
FROM golang:${GO_VERSION}-bullseye AS faillint
5252
RUN GO111MODULE=on go install github.com/fatih/faillint@v1.12.0
5353
RUN GO111MODULE=on go install golang.org/x/tools/cmd/goimports@v0.7.0
5454

55-
FROM golang:1.22.5-bookworm as delve
55+
FROM golang:${GO_VERSION}-bullseye AS delve
5656
RUN GO111MODULE=on go install github.com/go-delve/delve/cmd/dlv@latest
5757

5858
# Install ghr used to push binaries and template the release
5959
# 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.
60-
FROM golang:1.22.5-bookworm as ghr
60+
FROM golang:${GO_VERSION}-bullseye AS ghr
6161
RUN GO111MODULE=on go install github.com/tcnksm/ghr@9349474
6262

6363
# Install nfpm (https://nfpm.goreleaser.com) for creating .deb and .rpm packages.
64-
FROM golang:1.22.5-bookworm as nfpm
64+
FROM golang:${GO_VERSION}-bullseye AS nfpm
6565
RUN GO111MODULE=on go install github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.11.3
6666

6767
# Install gotestsum
68-
FROM golang:1.22.5-bookworm as gotestsum
68+
FROM golang:${GO_VERSION}-bullseye AS gotestsum
6969
RUN GO111MODULE=on go install gotest.tools/gotestsum@v1.8.2
7070

7171
# Install tools used to compile jsonnet.
72-
FROM golang:1.22.5-bookworm as jsonnet
72+
FROM golang:${GO_VERSION}-bullseye AS jsonnet
7373
RUN GO111MODULE=on go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.5.1
7474
RUN GO111MODULE=on go install github.com/monitoring-mixins/mixtool/cmd/mixtool@16dc166166d91e93475b86b9355a4faed2400c18
7575
RUN GO111MODULE=on go install github.com/google/go-jsonnet/cmd/jsonnet@v0.20.0
7676

77-
FROM aquasec/trivy as trivy
77+
FROM aquasec/trivy AS trivy
7878

79-
FROM golang:1.22.5-bookworm
79+
FROM golang:${GO_VERSION}-bullseye
8080
RUN apt-get update && \
8181
apt-get install -qy \
8282
musl gnupg ragel \

‎loki-build-image/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
## Versions
44

5+
### 0.33.7
6+
7+
- Revert Golang base image to Debian Bullseye
8+
9+
### 0.33.6
10+
11+
- Update to go 1.22.6
12+
13+
### 0.33.5
14+
15+
- Update to alpine 3.20.2
16+
17+
### 0.33.4
18+
19+
- Update to go 1.22.5
20+
521
### 0.33.2
622

723
- Update to go 1.22.2

‎pkg/querier/queryrange/queryrangebase/queryrange.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/querier/stats/stats.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pkg/ruler/base/ruler.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)