From 44e937904350e5d559ebcada2c4cbef0c2f1704f Mon Sep 17 00:00:00 2001 From: Yuri Shkuro Date: Sat, 29 Jun 2024 15:13:49 -0400 Subject: [PATCH] fix Signed-off-by: Yuri Shkuro --- .github/workflows/build-and-publish.yml | 17 ++++++++++------- Dockerfile | 8 ++++---- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index fd264cd..9bdabbc 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -19,11 +19,9 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - uses: docker/setup-buildx-action@v3 with: install: true @@ -41,6 +39,7 @@ jobs: type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} type=semver,pattern={{version}} type=ref,event=tag + type=sha - name: Login to DockerHub if: github.event_name != 'pull_request' @@ -50,11 +49,15 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Build and maybe push Docker image - uses: docker/build-push-action@v5 + # TODO remove next line + if: github.event_name != 'pull_request' + uses: docker/build-push-action@v6.2 with: push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }} + load: github.event_name == 'pull_request' tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} + context: . cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 @@ -75,7 +78,7 @@ jobs: - name: Build Proto in Jaeger if: github.event_name == 'pull_request' working-directory: jaeger - run: make proto JAEGER_DOCKER_PROTOBUF=protobuf + run: make proto DOCKER_PROTOBUF_VERSION=latest - name: Checkout jaeger-idl for validation if: github.event_name == 'pull_request' @@ -88,4 +91,4 @@ jobs: - name: Build Proto in jaeger-idl if: github.event_name == 'pull_request' working-directory: jaeger-idl - run: make proto PROTOC_IMAGE=protobuf + run: make proto PROTOC_VER=latest diff --git a/Dockerfile b/Dockerfile index 4bd7bad..0eab25c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,11 @@ ARG PROTOC_GEN_GOGO_VERSION=b03c65ea87cdc3521ede29f62fe3ce239267c1bc ARG PROTOC_GEN_LINT_VERSION=0.2.1 ARG UPX_VERSION=3.96 -FROM alpine:${ALPINE_VERSION} as protoc_base +FROM alpine:${ALPINE_VERSION} AS protoc_base RUN apk add --no-cache build-base curl cmake autoconf libtool git zlib-dev linux-headers && \ mkdir -p /out -FROM protoc_base as protoc_builder +FROM protoc_base AS protoc_builder ARG GRPC_VERSION RUN apk add --no-cache automake ninja && \ git clone --recursive --depth=1 -b v${GRPC_VERSION} https://github.com/grpc/grpc.git /grpc && \ @@ -72,7 +72,7 @@ RUN git clone --recursive --depth=1 -b v${GRPC_CSHARP_VERSION} https://github.co rm -Rf /grpc -FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as go_builder +FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS go_builder RUN apk add --no-cache build-base curl git ENV GOBIN=/out/usr/bin @@ -114,7 +114,7 @@ RUN mkdir -p ${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway && \ install -D $(find ./third_party/googleapis/google/rpc -name '*.proto') -t /out/usr/include/google/rpc -FROM alpine:${ALPINE_VERSION} as packer +FROM alpine:${ALPINE_VERSION} AS packer RUN apk add --no-cache curl ARG UPX_VERSION