Skip to content

Commit

Permalink
hack: update proto generators for arm64
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
  • Loading branch information
tonistiigi committed Jun 7, 2021
1 parent 8e88c5d commit e763d21
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions hack/dockerfiles/generated-files.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ ARG GOGO_VERSION=v1.3.2
RUN apt-get update && apt-get --no-install-recommends install -y \
unzip \
&& true
RUN wget -q https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip && unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local

ARG TARGETOS TARGETARCH
RUN set -e; \
if [ "$TARGETARCH" = "amd64" ]; then TARGETARCH=x86_64; fi; \
if [ "$TARGETARCH" = "arm64" ]; then TARGETARCH=aarch_64; fi; \
wget -q https://github.com/google/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${TARGETOS}-${TARGETARCH}.zip && unzip protoc-${PROTOC_VERSION}-${TARGETOS}-${TARGETARCH}.zip -d /usr/local

RUN git clone https://github.com/gogo/protobuf.git /go/src/github.com/gogo/protobuf \
&& cd /go/src/github.com/gogo/protobuf \
Expand All @@ -33,7 +38,7 @@ RUN mkdir /generated-files
RUN --mount=target=/tmp/src \
cp -r /tmp/src/. . && \
git add -A && \
go generate ./... && \
go generate -mod=vendor -v ./... && \
git ls-files -m --others -- **/*.pb.go | tar -cf - --files-from - | tar -C /generated-files -xf -

FROM scratch AS update
Expand All @@ -42,4 +47,4 @@ COPY --from=generated /generated-files /generated-files
FROM gobuild-base AS validate
RUN --mount=target=/tmp/src \
cp -r /tmp/src/. . && \
go generate ./... && git diff && ./hack/validate-generated-files check
go generate -mod=vendor ./... -v && git diff && ./hack/validate-generated-files check

0 comments on commit e763d21

Please sign in to comment.