Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(build): Use Debian Bullseye base image for build image #14368

Merged
merged 5 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.0"
"build_image": "grafana/loki-build-image:0.34.1"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"check":
"uses": "grafana/loki-release/.github/workflows/check.yml@main"
"with":
"build_image": "grafana/loki-build-image:0.34.0"
"build_image": "grafana/loki-build-image:0.34.1"
"golang_ci_lint_version": "v1.60.3"
"release_lib_ref": "main"
"skip_validation": false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.0"
build_image: "grafana/loki-build-image:0.34.1"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/patch-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
check:
uses: "grafana/loki-release/.github/workflows/check.yml@main"
with:
build_image: "grafana/loki-build-image:0.34.0"
build_image: "grafana/loki-build-image:0.34.1"
golang_ci_lint_version: "v1.60.3"
release_lib_ref: "main"
skip_validation: false
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
--env SKIP_ARM \
--volume .:/src/loki \
--workdir /src/loki \
--entrypoint /bin/sh "grafana/loki-build-image:0.34.0"
--entrypoint /bin/sh "grafana/loki-build-image:0.34.1"
git config --global --add safe.directory /src/loki
echo "${NFPM_SIGNING_KEY}" > $NFPM_SIGNING_KEY_FILE
make dist packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,4 @@ name: "create release"
permissions:
contents: "write"
id-token: "write"
pull-requests: "write"
pull-requests: "write"
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ DOCKER_IMAGE_DIRS := $(patsubst %/Dockerfile,%,$(DOCKERFILES))
BUILD_IN_CONTAINER ?= true

# ensure you run `make release-workflows` after changing this
BUILD_IMAGE_VERSION ?= 0.34.0
BUILD_IMAGE_VERSION ?= 0.34.1
GO_VERSION := 1.23.1

# Docker image info
Expand Down Expand Up @@ -664,7 +664,7 @@ else
endif

build-image: ensure-buildx-builder
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(IMAGE_TAG) ./loki-build-image
$(SUDO) $(BUILD_OCI) --build-arg=GO_VERSION=$(GO_VERSION) -t $(IMAGE_PREFIX)/loki-build-image:$(BUILD_IMAGE_VERSION) ./loki-build-image
build-image-push: build-image ## push the docker build image
ifneq (,$(findstring WIP,$(IMAGE_TAG)))
@echo "Cannot push a WIP image, commit changes first"; \
Expand Down
20 changes: 11 additions & 9 deletions loki-build-image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
# See ../docs/sources/community/maintaining/release-loki-build-image.md for instructions
# on how to publish a new build image.
ARG GO_VERSION=1.23
ARG GOLANG_BASE_IMAGE=golang:${GO_VERSION}-bullseye

# Install helm (https://helm.sh/) and helm-docs (https://github.com/norwoodj/helm-docs) for generating Helm Chart reference.
FROM golang:${GO_VERSION}-bookworm AS helm
FROM ${GOLANG_BASE_IMAGE} 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 && \
Expand Down Expand Up @@ -38,7 +40,7 @@ RUN apk add --no-cache curl && \
FROM alpine:3.20.3 AS docker
RUN apk add --no-cache docker-cli docker-cli-buildx

FROM golang:${GO_VERSION}-bookworm AS drone
FROM ${GOLANG_BASE_IMAGE} 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
Expand All @@ -48,35 +50,35 @@ RUN curl -L "https://github.com/drone/drone-cli/releases/download/v1.7.0/drone_l
# Error:
# github.com/fatih/[email protected] requires golang.org/x/[email protected]
# (not golang.org/x/[email protected] from golang.org/x/tools/cmd/goyacc@58d531046acdc757f177387bc1725bfa79895d69)
FROM golang:${GO_VERSION}-bookworm AS faillint
FROM ${GOLANG_BASE_IMAGE} AS faillint
RUN GO111MODULE=on go install github.com/fatih/[email protected]
RUN GO111MODULE=on go install golang.org/x/tools/cmd/[email protected]

FROM golang:${GO_VERSION}-bookworm AS delve
FROM ${GOLANG_BASE_IMAGE} 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:${GO_VERSION}-bookworm AS ghr
FROM ${GOLANG_BASE_IMAGE} 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:${GO_VERSION}-bookworm AS nfpm
FROM ${GOLANG_BASE_IMAGE} AS nfpm
RUN GO111MODULE=on go install github.com/goreleaser/nfpm/v2/cmd/[email protected]

# Install gotestsum
FROM golang:${GO_VERSION}-bookworm AS gotestsum
FROM ${GOLANG_BASE_IMAGE} AS gotestsum
RUN GO111MODULE=on go install gotest.tools/[email protected]

# Install tools used to compile jsonnet.
FROM golang:${GO_VERSION}-bookworm AS jsonnet
FROM ${GOLANG_BASE_IMAGE} AS jsonnet
RUN GO111MODULE=on go install github.com/jsonnet-bundler/jsonnet-bundler/cmd/[email protected]
RUN GO111MODULE=on go install github.com/monitoring-mixins/mixtool/cmd/mixtool@16dc166166d91e93475b86b9355a4faed2400c18
RUN GO111MODULE=on go install github.com/google/go-jsonnet/cmd/[email protected]

FROM aquasec/trivy AS trivy

FROM golang:${GO_VERSION}-bookworm
FROM ${GOLANG_BASE_IMAGE}
RUN apt-get update && \
apt-get install -qy \
musl gnupg ragel \
Expand Down
Loading