Skip to content

Commit ea51671

Browse files
update protos image and fix it for linux/amd64 (#316)
1 parent c620a62 commit ea51671

File tree

10 files changed

+98
-9
lines changed

10 files changed

+98
-9
lines changed

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
PROTOS_IMAGE ?= us-docker.pkg.dev/thog-artifacts/public/go-ci-1.17-1
1+
PROTOS_IMAGE ?= trufflesecurity/protos:1.18-0
22

33
.PHONY: check
44
.PHONY: test
@@ -47,5 +47,10 @@ protos:
4747
protos-windows:
4848
docker run -v "$(shell cygpath -w $(shell pwd))":/pwd "${PROTOS_IMAGE}" bash -c "cd /pwd; ./scripts/gen_proto.sh"
4949

50+
release-protos-image:
51+
docker buildx build --push --platform=linux/amd64,linux/arm64 \
52+
-t trufflesecurity/protos:1.18-0 -f hack/Dockerfile.protos .
53+
5054
snifftest:
5155
./hack/snifftest/snifftest.sh
56+

hack/Dockerfile.protos

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# trufflesecurity/protos:1.18-0
2+
3+
FROM golang:1.18-buster
4+
5+
ARG TARGETARCH
6+
ARG TARGETOS
7+
ENV PROTOC_VER=3.20.0
8+
ENV GORELEASER_VER=v1.7.0
9+
ENV SQLBOILER_VER=v4.9.0
10+
ENV PROTOC_GEN_GO_VER=v1.5.2
11+
12+
RUN echo "building $TARGETARCH"
13+
RUN apt-get update; apt-get install -y --no-install-recommends git unzip && rm -rf /var/lib/apt/lists/*
14+
RUN set -e; \
15+
arch=$(echo $TARGETARCH | sed -e s/amd64/x86_64/ -e s/arm64/aarch_64/); \
16+
wget -q https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-${TARGETOS}-${arch}.zip && unzip protoc-${PROTOC_VER}-${TARGETOS}-${arch}.zip -d /usr/local
17+
RUN go install "github.com/golang/protobuf/protoc-gen-go@${PROTOC_GEN_GO_VER}"
18+
RUN GO111MODULE=off go get -d "github.com/envoyproxy/protoc-gen-validate" && \
19+
cd $GOPATH/src/github.com/envoyproxy/protoc-gen-validate && \
20+
git checkout v0.6.7 && \
21+
ln -s /usr/local/protoc/include/google google && \
22+
make build
23+
CMD ["bash"]

pkg/pb/credentialspb/credentials.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/pb/credentialspb/credentials.pb.validate.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/pb/detectorspb/detectors.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/pb/detectorspb/detectors.pb.validate.go

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/pb/source_metadatapb/source_metadata.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/pb/source_metadatapb/source_metadata.pb.validate.go

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/pb/sourcespb/sources.pb.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)