Skip to content

Commit

Permalink
ci: fix the docker driver build
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorwhitney committed Dec 10, 2024
1 parent bb57ffe commit b8a2407
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/release-workflows.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local imageJobs = {
'loki-canary-boringcrypto': build.image('loki-canary-boringcrypto', 'cmd/loki-canary-boringcrypto'),
promtail: build.image('promtail', 'clients/cmd/promtail'),
querytee: build.image('loki-query-tee', 'cmd/querytee', platform=['linux/amd64']),
'loki-docker-driver': build.dockerPlugin('grafana/loki-docker-driver', 'clients/cmd/docker-driver', platform=['linux/amd64', 'linux/arm64']),
'loki-docker-driver': build.dockerPlugin('loki-docker-driver', 'clients/cmd/docker-driver', platform=['linux/amd64', 'linux/arm64']),
};

local weeklyImageJobs = {
Expand Down Expand Up @@ -105,6 +105,7 @@ local imagePrefix = 'grafana';
'images.yml': std.manifestYamlDoc({
name: 'publish images',
on: {
pull_request: {},
push: {
branches: [
'k[0-9]+*', // This is a weird glob pattern, not a regexp, do not use ".*", see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@
"tags": "${{ env.IMAGE_PREFIX }}/promtail:${{ steps.weekly-version.outputs.version }}"
"name": "publish images"
"on":
"pull_request": {}
"push":
"branches":
- "k[0-9]+*"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/minor-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,10 @@ jobs:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}"
context: "release"
file: "release/clients/cmd/docker-driver/Dockerfile"
outputs: "type=docker,dest=release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
outputs: "type=docker,dest=release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
platforms: "${{ matrix.platform }}"
push: false
tags: "${{ env.IMAGE_PREFIX }}/grafana/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
tags: "${{ env.IMAGE_PREFIX }}/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
- env:
BUILD_DIR: "release/clients/cmd/docker-driver"
IMAGE_TAG: "${{ needs.version.outputs.version }}"
Expand All @@ -671,7 +671,7 @@ jobs:
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
path: "release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
fail-fast: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/patch-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -651,10 +651,10 @@ jobs:
build-args: "IMAGE_TAG=${{ needs.version.outputs.version }},GOARCH=${{ steps.platform.outputs.platform_short }}"
context: "release"
file: "release/clients/cmd/docker-driver/Dockerfile"
outputs: "type=docker,dest=release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
outputs: "type=docker,dest=release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
platforms: "${{ matrix.platform }}"
push: false
tags: "${{ env.IMAGE_PREFIX }}/grafana/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
tags: "${{ env.IMAGE_PREFIX }}/loki-docker-driver:${{ needs.version.outputs.version }}-${{ steps.platform.outputs.platform_short }}"
- env:
BUILD_DIR: "release/clients/cmd/docker-driver"
IMAGE_TAG: "${{ needs.version.outputs.version }}"
Expand All @@ -671,7 +671,7 @@ jobs:
uses: "google-github-actions/upload-cloud-storage@v2"
with:
destination: "${{ env.BUILD_ARTIFACTS_BUCKET }}/${{ github.sha }}/images"
path: "release/images/grafana/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
path: "release/images/loki-docker-driver-${{ needs.version.outputs.version}}-${{ steps.platform.outputs.platform }}.tar"
process_gcloudignore: false
strategy:
fail-fast: true
Expand Down
4 changes: 2 additions & 2 deletions clients/cmd/docker-driver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
ARG BUILD_IMAGE=grafana/loki-build-image:0.34.0
ARG GO_VERSION=1.23
ARG GOARCH=amd64
# 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-docker-driver -f clients/cmd/docker-driver/Dockerfile .

FROM $BUILD_IMAGE AS build
FROM golang:${GO_VERSION}-bookworm as build
COPY . /src/loki
WORKDIR /src/loki

Expand Down

0 comments on commit b8a2407

Please sign in to comment.