diff --git a/Dockerfile b/Dockerfile index a864b19..05b89d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,10 @@ FROM rust:1.62 as builder ADD ./src ./builder/src ADD ./Cargo.toml ./builder/Cargo.toml -ADD ./.cargo ./builder/.cargo ADD ./build.rs ./builder/build.rs +RUN apt update && apt install -y protobuf-compiler + WORKDIR /builder RUN rustup default nightly diff --git a/build.rs b/build.rs index 1e5220f..86d86a7 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,6 @@ fn main() -> Result<(), Box> { - tonic_build::compile_protos("src/proto/kipdb.proto")?; + tonic_build::configure() + .protoc_arg("--experimental_allow_proto3_optional") + .compile(&["src/proto/kipdb.proto"], &["src/proto"])?; Ok(()) }