From db844c3aeaf4378eeb003177c0d3973145608051 Mon Sep 17 00:00:00 2001 From: Joe Hrbek <123987499+suiwombat@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:28:31 -0500 Subject: [PATCH] [docker/tidb-indexer] (#18824) ## Description add dockerfile for tidb indexer ## Test Plan tsia --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API: --- docker/sui-indexer-tidb/Dockerfile | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docker/sui-indexer-tidb/Dockerfile diff --git a/docker/sui-indexer-tidb/Dockerfile b/docker/sui-indexer-tidb/Dockerfile new file mode 100644 index 0000000000000..d1d46bf81024c --- /dev/null +++ b/docker/sui-indexer-tidb/Dockerfile @@ -0,0 +1,37 @@ +# Build application +# +# Copy in all crates, Cargo.toml and Cargo.lock unmodified, +# and build the application. +FROM rust:1.75-bullseye AS builder +ARG PROFILE=release +ARG GIT_REVISION +ENV GIT_REVISION=$GIT_REVISION +WORKDIR "$WORKDIR/sui" + +# sui-indexer needs postgres libpq5 and ca-certificates +RUN apt update && apt install -y libpq5 ca-certificates libpq-dev postgresql + +RUN apt-get update && apt-get install -y cmake clang + +COPY Cargo.toml Cargo.lock ./ +COPY consensus consensus +COPY crates crates +COPY sui-execution sui-execution +COPY narwhal narwhal +COPY external-crates external-crates + +RUN cargo build --profile ${PROFILE} --bin sui-indexer --features mysql-feature --no-default-features + +# Production Image +FROM debian:bullseye-slim AS runtime +# Use jemalloc as memory allocator +RUN apt-get update && apt-get install -y libjemalloc-dev ca-certificates curl +ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so +WORKDIR "$WORKDIR/sui" +COPY --from=builder /sui/target/release/sui-indexer /usr/local/bin +RUN apt update && apt install -y libpq5 ca-certificates libpq-dev postgresql + +ARG BUILD_DATE +ARG GIT_REVISION +LABEL build-date=$BUILD_DATE +LABEL git-revision=$GIT_REVISION