diff --git a/Dockerfile b/Dockerfile index f7c92df8..82728584 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ ARG node_version ARG node_grpc_tools_node_protoc_ts_version ARG node_grpc_tools_version ARG node_protoc_gen_grpc_web_version +ARG go_envoyproxy_pgv_version FROM golang:$go_version-$debian AS build @@ -18,6 +19,7 @@ ARG grpc_gateway_version ARG grpc_java_version ARG grpc_web_version ARG scala_pb_version +ARG go_envoyproxy_pgv_version RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ build-essential \ @@ -89,8 +91,8 @@ RUN go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc RUN go get -u github.com/micro/micro/cmd/protoc-gen-micro -RUN go get -d github.com/envoyproxy/protoc-gen-validate -RUN make -C /go/src/github.com/envoyproxy/protoc-gen-validate/ build +RUN GO111MODULE=on go get -d github.com/envoyproxy/protoc-gen-validate@v${go_envoyproxy_pgv_version} +RUN make -C /go/pkg/mod/github.com/envoyproxy/protoc-gen-validate@v${go_envoyproxy_pgv_version}/ build RUN go get -u github.com/mwitkow/go-proto-validators/protoc-gen-govalidators @@ -122,6 +124,8 @@ ARG node_grpc_tools_node_protoc_ts_version ARG node_grpc_tools_version ARG node_protoc_gen_grpc_web_version +ARG go_envoyproxy_pgv_version + RUN mkdir -p /usr/share/man/man1 RUN set -ex && apt-get update && apt-get install -y --no-install-recommends \ bash \ @@ -164,7 +168,7 @@ COPY --from=build /tmp/protoc-gen-scala /usr/local/bin/ COPY --from=build /go/pkg/mod/github.com/grpc-ecosystem/grpc-gateway/v2@v${grpc_gateway_version}/protoc-gen-openapiv2/options /opt/include/protoc-gen-openapiv2/options/ -COPY --from=build /go/src/github.com/envoyproxy/protoc-gen-validate/ /opt/include/ +COPY --from=build /go/pkg/mod/github.com/envoyproxy/protoc-gen-validate@v${go_envoyproxy_pgv_version}/ /opt/include/ COPY --from=build /go/src/github.com/mwitkow/go-proto-validators/ /opt/include/github.com/mwitkow/go-proto-validators/ ADD all/entrypoint.sh /usr/local/bin diff --git a/build.sh b/build.sh index 0295a390..33260450 100755 --- a/build.sh +++ b/build.sh @@ -18,6 +18,7 @@ for build in ${BUILDS[@]}; do --build-arg node_grpc_tools_node_protoc_ts_version=${NODE_GRPC_TOOLS_NODE_PROTOC_TS_VERSION} \ --build-arg node_grpc_tools_version=${NODE_GRPC_TOOLS_VERSION} \ --build-arg node_protoc_gen_grpc_web_version=${NODE_PROTOC_GET_GRPC_WEB_VERSION} \ + --build-arg go_envoyproxy_pgv_version=${GO_ENVOYPROXY_PGV_VERSION} \ --target ${build} \ . diff --git a/variables.sh b/variables.sh index 9aa34d79..bcc703d6 100755 --- a/variables.sh +++ b/variables.sh @@ -17,5 +17,6 @@ NODE_VERSION=${NODE_VERSION:-14} NODE_GRPC_TOOLS_NODE_PROTOC_TS_VERSION=${NODE_GRPC_TOOLS_NODE_PROTOC_TS_VERSION:-5.1.3} NODE_GRPC_TOOLS_VERSION=${NODE_GRPC_TOOLS_VERSION:-1.11.1} NODE_PROTOC_GET_GRPC_WEB_VERSION=${NODE_PROTOC_GET_GRPC_WEB_VERSION:-1.2.1} +GO_ENVOYPROXY_PGV_VERSION=${GO_ENVOYPROXY_PGV_VERSION:-0.6.1} BUILD_VERSION="${BUILD_VERSION:-local}" VERSION="${VERSION:-${GRPC_VERSION}_${BUILD_VERSION}}"