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

[chore] updating versions and adding TARGETARCH #134

Merged
merged 3 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 8 additions & 1 deletion .github/workflows/protobuf-dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@ on:

jobs:
build:
strategy:
matrix:
TARGETARCH: [amd64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build protobuf/. -t build-protobuf
env:
TARGETARCH: ${{ matrix.TARGETARCH }}
- name: Push the Docker image
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
run: |
Expand All @@ -31,4 +36,6 @@ jobs:
tag_and_push "${TAG}"
else
tag_and_push "${GITHUB_REF#"refs/tags/"}"
fi
fi
env:
TARGETARCH: ${{ matrix.TARGETARCH }}
26 changes: 15 additions & 11 deletions protobuf/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
ARG ALPINE_VERSION=3.14
ARG GO_VERSION=1.17.1
ARG ALPINE_VERSION=3.17
ARG GO_VERSION=1.20
# gRPC core version that applies to C++, C#, Objective-C, PhP, Python, Ruby
ARG GRPC_VERSION=1.41.0
ARG PROTOBUF_C_VERSION=1.4.0
ARG GRPC_VERSION=1.52.0
ARG PROTOBUF_C_VERSION=1.4.1
ARG GRPC_WEB_VERSION=1.3.0

ARG PROTOC_GEN_GO_VERSION=1.5.2
ARG PROTOC_GEN_GO_GRPC_VERSION=1.41.0
ARG GRPC_JAVA_VERSION=1.41.0
ARG GRPC_JAVA_VERSION=1.51.3
# v1.3.2, using the version directly does not work: "tar: invalid magic"
ARG PROTOC_GEN_GOGO_VERSION=b03c65ea87cdc3521ede29f62fe3ce239267c1bc
ARG PROTOC_GEN_LINT_VERSION=0.2.4
ARG GRPC_GATEWAY_VERSION=2.6.0
ARG PROTOC_GEN_LINT_VERSION=0.3.0
ARG GRPC_GATEWAY_VERSION=2.15.0
ARG PROTOC_GEN_PARQUET_VERSION=0.4.3
ARG UPX_VERSION=3.96
ARG UPX_VERSION=4.0.2

ARG TARGETARCH=amd64


FROM alpine:${ALPINE_VERSION} as protoc_builder
Expand Down Expand Up @@ -103,11 +105,12 @@ RUN mkdir -p ${GOPATH}/src/github.com/gogo/protobuf && \
install -D ./gogoproto/gogo.proto /out/usr/include/github.com/gogo/protobuf/gogoproto/gogo.proto

ARG PROTOC_GEN_LINT_VERSION
ARG TARGETARCH
RUN cd / && \
curl -sSLO https://github.com/ckaznocha/protoc-gen-lint/releases/download/v${PROTOC_GEN_LINT_VERSION}/protoc-gen-lint_linux_amd64.zip && \
curl -sSLO https://github.com/ckaznocha/protoc-gen-lint/releases/download/v${PROTOC_GEN_LINT_VERSION}/protoc-gen-lint_linux_${TARGETARCH}.zip && \
mkdir -p /protoc-gen-lint-out && \
cd /protoc-gen-lint-out && \
unzip -q /protoc-gen-lint_linux_amd64.zip && \
unzip -q /protoc-gen-lint_linux_${TARGETARCH}.zip && \
install -Ds /protoc-gen-lint-out/protoc-gen-lint /out/usr/bin/protoc-gen-lint

ARG GRPC_GATEWAY_VERSION
Expand All @@ -134,7 +137,8 @@ FROM alpine:${ALPINE_VERSION} as packer
RUN apk add --no-cache curl

ARG UPX_VERSION
RUN mkdir -p /upx && curl -sSL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-amd64_linux.tar.xz | tar xJ --strip 1 -C /upx && \
ARG TARGETARCH
RUN mkdir -p /upx && curl -sSL https://github.com/upx/upx/releases/download/v${UPX_VERSION}/upx-${UPX_VERSION}-${TARGETARCH}_linux.tar.xz | tar xJ --strip 1 -C /upx && \
install -D /upx/upx /usr/local/bin/upx

# Use all output including headers and protoc from protoc_builder
Expand Down