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

Update codegen image #4498

Merged
merged 2 commits into from
Jul 14, 2023
Merged
Changes from all 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
24 changes: 9 additions & 15 deletions tool/codegen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,26 @@
# Builder image to build go program.
FROM golang:1.20.5-alpine3.18 as BUILDER
FROM golang:1.20.4-alpine3.16 as BUILDER

COPY protoc-gen-auth /protoc-gen-auth
RUN cd /protoc-gen-auth \
&& go build -o /usr/local/bin/protoc-gen-auth . \
&& chmod +x /usr/local/bin/protoc-gen-auth

# Codegen image which is actually being used.
FROM golang:1.20.5-alpine3.18
FROM golang:1.20.4-alpine3.16

ENV PROTOC_VER=3.19.4
# This is version of protobuf installed in the image.
# See https://pkgs.alpinelinux.org/packages?name=protobuf&branch=v3.16
# NOTE: Start from protobuf v3.20.1, the protoc-gen-js is not included in protobuf package.
ENV PROTOC_VER=3.18.1
ENV PROTOC_GEN_GO_VER=1.27.1
ENV PROTOC_GEN_GRPC_WEB_VER=1.3.1
ENV PROTOC_GEN_GO_GRPC_VER=1.2.0
ENV PROTOC_GEN_VALIDATE_VER=0.6.6
ENV GOMOCK_VER=1.6.0
ENV GLIBC_VERSION=2.35-r1

RUN apk --no-cache add wget bash \
&& wget -q https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -O /etc/apk/keys/sgerrand.rsa.pub \
&& wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${GLIBC_VERSION}/glibc-${GLIBC_VERSION}.apk -O glibc.apk \
&& apk add glibc.apk \
&& rm /etc/apk/keys/sgerrand.rsa.pub glibc.apk

# protoc
RUN wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip -O protoc.zip \
&& unzip protoc.zip -d /usr/local \
&& rm protoc.zip

# dependecies and protoc
RUN apk --no-cache add wget bash protobuf-dev protobuf

# protoc-gen-go
RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v${PROTOC_GEN_GO_VER}
Expand Down