Skip to content

Commit 2f8b983

Browse files
Add lyft/protoc-gen-validate
Requires `strings.Builder`, which was introduced in Go 1.10, hence the update to alpine:3.8 At this time lyft/protoc-gen-validate must be compiled manually using `make build`
1 parent b601117 commit 2f8b983

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.7 as protoc_builder
1+
FROM alpine:3.8 as protoc_builder
22
RUN apk add --no-cache build-base curl automake autoconf libtool git zlib-dev
33

44
ENV GRPC_VERSION=1.16.0 \
@@ -66,8 +66,10 @@ RUN go get -u -v -ldflags '-w -s' \
6666
github.com/johanbrandhorst/protobuf/protoc-gen-gopherjs \
6767
github.com/ckaznocha/protoc-gen-lint \
6868
github.com/mwitkow/go-proto-validators/protoc-gen-govalidators \
69+
github.com/lyft/protoc-gen-validate \
6970
moul.io/protoc-gen-gotemplate \
7071
github.com/micro/protoc-gen-micro \
72+
&& (cd ${GOPATH}/src/github.com/lyft/protoc-gen-validate && make build) \
7173
&& install -c ${GOPATH}/bin/protoc-gen* ${OUTDIR}/usr/bin/
7274

7375
RUN mkdir -p ${GOPATH}/src/github.com/pseudomuto/protoc-gen-doc && \
@@ -166,6 +168,10 @@ RUN apk add --no-cache curl && \
166168
curl -L -o /protobuf/github.com/gogo/protobuf/gogoproto/gogo.proto https://raw.githubusercontent.com/gogo/protobuf/master/gogoproto/gogo.proto && \
167169
mkdir -p /protobuf/github.com/mwitkow/go-proto-validators && \
168170
curl -L -o /protobuf/github.com/mwitkow/go-proto-validators/validator.proto https://raw.githubusercontent.com/mwitkow/go-proto-validators/master/validator.proto && \
171+
mkdir -p /protobuf/github.com/lyft/protoc-gen-validate/gogoproto && \
172+
mkdir -p /protobuf/github.com/lyft/protoc-gen-validate/validate && \
173+
curl -L -o /protobuf/github.com/lyft/protoc-gen-validate/gogoproto/gogo.proto https://raw.githubusercontent.com/lyft/protoc-gen-validate/master/gogoproto/gogo.proto && \
174+
curl -L -o /protobuf/github.com/lyft/protoc-gen-validate/validate/validate.proto https://raw.githubusercontent.com/lyft/protoc-gen-validate/master/validate/validate.proto && \
169175
apk del curl
170176

171177
ENTRYPOINT ["/usr/bin/protoc", "-I/protobuf"]

0 commit comments

Comments
 (0)