From 2c10d2085530726fa7df5457da02d10b5756816e Mon Sep 17 00:00:00 2001 From: Raminder Singh Date: Fri, 19 Jul 2024 16:50:56 +0530 Subject: [PATCH] add a dockerfile for replicator --- .dockerignore | 1 + README.md | 4 ++++ replicator/Dockerfile | 12 ++++++++++++ 3 files changed, 17 insertions(+) create mode 100644 .dockerignore create mode 100644 replicator/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c41cc9e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +/target \ No newline at end of file diff --git a/README.md b/README.md index 8e7ec4f..4002cbb 100644 --- a/README.md +++ b/README.md @@ -64,3 +64,7 @@ CDC stream is not the only kind of data a data pipeline performs. There's also f ## Performance Currently the data source and sinks copy table row and CDC events one at a time. This is expected to be slow. Batching, and other strategies will likely improve the performance drastically. But at this early stage the focus is on correctness rather than performance. There are also zero benchmarks at this stage, so commentary about performance is closer to speculation than reality. + +## Docker + +To create the docker image for replicator run `docker build -f ./replicator/Dockerfile .` from the root of the repo. \ No newline at end of file diff --git a/replicator/Dockerfile b/replicator/Dockerfile new file mode 100644 index 0000000..1b9a91f --- /dev/null +++ b/replicator/Dockerfile @@ -0,0 +1,12 @@ +FROM rust:1.79.0-slim-bookworm as builder +WORKDIR /app +# TODO: remove protobuf-compiler once the upstream gcp-bigquery-client remove it from its deps +RUN apt update && apt install protobuf-compiler clang -y +COPY . . +RUN cargo build --release -p replicator + +FROM rust:1.79.0-slim-bookworm as runtime +WORKDIR /app +COPY --from=builder /app/target/release/replicator replicator +COPY replicator/configuration configuration +ENTRYPOINT ["./replicator"] \ No newline at end of file